From 63276458ddec5bfbe3aee3bbe6f26f713af864b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Mon, 1 Jul 2013 04:31:53 +0200 Subject: [PATCH] Migrate RETURN-FROM --- src/compiler.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 3826be6..4e35973 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -783,14 +783,15 @@ ;; 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* -- 1.7.10.4