Migrate toplevel code emitted as result of literals
authorDavid Vázquez <davazp@gmail.com>
Fri, 5 Jul 2013 15:19:16 +0000 (17:19 +0200)
committerDavid Vázquez <davazp@gmail.com>
Fri, 5 Jul 2013 15:19:16 +0000 (17:19 +0200)
src/compiler.lisp

index 79bf250..931e9a2 100644 (file)
                dumped
                (let ((jsvar (genlit)))
                  (push (cons sexp jsvar) *literal-table*)
-                 (toplevel-compilation `(code "var " ,jsvar " = " ,dumped))
+                 (toplevel-compilation `(var (,(make-symbol jsvar) ,dumped)))
                  (when (keywordp sexp)
-                   (toplevel-compilation `(code ,jsvar ".value = " ,jsvar)))
+                   (toplevel-compilation `(= ,(get (make-symbol jsvar) "value") ,(make-symbol jsvar))))
                  jsvar)))))))