Migrate CONS
[jscl.git] / src / compiler.lisp
index d939651..6d24adf 100644 (file)
 
 (define-builtin consp (x)
   (js!bool
-   (js!selfcall
-     "var tmp = " x ";"
-     "return (typeof tmp == 'object' && 'car' in tmp);" )))
+   (js!selfcall*
+     `(var (tmp ,x))
+     `(return (and (== (typeof tmp) "object")
+                   (in "car" tmp))))))
 
 (define-builtin car (x)
   (js!selfcall*