Refactored compile-parenscript-form code.
[clinton/parenscript.git] / src / printer.lisp
index edaa39d..97c6d08 100644 (file)
@@ -42,7 +42,7 @@ arguments, defines a printer for that form using the given body."
 (defmethod ps-print ((form null))) ; don't print top-level nils (ex: result of defining macros, etc.)
 
 (defmethod ps-print ((s symbol))
-  (assert (keywordp s))
+  (assert (keywordp s) nil "~S is not a symbol" s)
   (ps-print (string-downcase s)))
 
 (defmethod ps-print ((compiled-form cons))
@@ -172,12 +172,8 @@ arguments, defines a printer for that form using the given body."
 (defprinter js:object (&rest slot-defs)
   (psw "{ ")
   (loop for ((slot-name . slot-value) . remaining) on slot-defs do
-        (if (and (listp slot-name) (eq 'quote (car slot-name)) (symbolp (second slot-name)))
-            (psw (symbol-to-js-string (second slot-name)))
-            (ps-print slot-name))
-        (psw " : ")
-        (ps-print slot-value)
-        (when remaining (psw ", ")))
+       (ps-print slot-name) (psw " : ") (ps-print slot-value)
+       (when remaining (psw ", ")))
   (psw " }"))
 
 (defprinter js:slot-value (obj slot)