Migrate RETURN-FROM
authorDavid Vázquez <davazp@gmail.com>
Mon, 1 Jul 2013 02:31:53 +0000 (04:31 +0200)
committerDavid Vázquez <davazp@gmail.com>
Mon, 1 Jul 2013 02:31:53 +0000 (04:31 +0200)
src/compiler.lisp

index 3826be6..4e35973 100644 (file)
     ;; unique identifier of the block as exception. We can't use the
     ;; variable name itself, because it could not to be unique, so we
     ;; capture it in a closure.
-    (js!selfcall
-      (when multiple-value-p `(code "var values = mv;" ))
-      "throw ({"
-      "type: 'block', "
-      "id: " (binding-value b) ", "
-      "values: " (ls-compile value multiple-value-p) ", "
-      "message: 'Return from unknown block " (symbol-name name) ".'"
-      "})")))
+    (js!selfcall*
+      (when multiple-value-p
+        `(var (|values| |mv|)))
+      `(throw
+           (object
+            "type" "block"
+            "id" ,(make-symbol (binding-value b))
+            "values" ,(ls-compile value multiple-value-p)
+            "message" ,(concat "Return from unknown block '" (symbol-name name) "'."))))))
 
 (define-compilation catch (id &rest body)
   (js!selfcall*