Uploaded image for project: 'ClojureScript'
  1. CLJS-1998

Printing an Object with a null prototype throws an error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: 1.9.293
    • Fix versions: 1.9.854
    • Labels:
      None
    • Approval:
      Accepted

      Description

      ClojureScript doesn't handle printing objects with a null prototype:

      (prn (.create js/Object nil)) ;;throws Uncaught TypeError: Cannot read property 'cljs$lang$ctorStr' of undefined
      (str (.create js/Object nil)) ;;throws Uncaught TypeError: Cannot convert object to primitive value
      

      For the first case, it looks like pr-writer-impl's last case needs a separate check for a nil object constructor. I've not yet investigated the second case.

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              bostonou Jonathan Boston
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: