From 574296549a1b671c84f8a6de4463c8af8db8ff48 Mon Sep 17 00:00:00 2001 From: Attila Lendvai Date: Sun, 16 Jul 2006 16:39:46 +0000 Subject: [PATCH] Fixed js-with WARNING: this involves syntax change Previously the syntax of with was this: (with (object) body) now it's: (with object body) It was also broken when 'object' was an expression... --- src/js.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js.lisp b/src/js.lisp index 66acbb2..296d704 100644 --- a/src/js.lisp +++ b/src/js.lisp @@ -335,7 +335,7 @@ prefix)." ,@(loop for variable in variables do (setf variable (symbol-to-js variable)) collect `(setf (slot-value new-context ,variable) (slot-value this ,variable))) - (with (new-context) + (with new-context (return ,expression)))))) (defvar *var-counter* 0) @@ -1202,8 +1202,8 @@ vice-versa.") (define-js-compiler-macro with (statement &rest body) (make-instance 'js-with - :obj (js-compile-to-expression (first statement)) - :body (js-compile-to-body (cons 'progn body) :indent " "))) + :obj (js-compile-to-expression statement) + :body (js-compile-to-body (cons 'progn body) :indent " "))) (defmethod js-to-statement-strings ((with js-with) start-pos) (nconc (dwim-join (list (js-to-strings (with-obj with) (+ start-pos 2))) -- 2.20.1