WITH-SLOTS had a problem with multiple evaluation:<div><br></div><div>(ps (with-slots (a b) (foo) (+ a b))) </div><div> => "foo().a + foo().b;"</div><div><br></div><div>I pushed a fix for that. Patch below.</div>
<div><br></div><div>Daniel</div><div><br></div><div><br></div><div><div>commit 305778c609dd6102b4a313ef436985551c29ee18</div><div>Author: Daniel Gackle <<a href="mailto:danielgackle@gmail.com">danielgackle@gmail.com</a>></div>
<div>Date: Fri Mar 1 17:17:04 2013 -0700</div><div><br></div><div> Fixed bug: multiple evaluation in WITH-SLOTS.</div><div><br></div><div>diff --git a/src/macros.lisp b/src/macros.lisp</div><div>index 5537872..b75f4b0 100644</div>
<div>--- a/src/macros.lisp</div><div>+++ b/src/macros.lisp</div><div>@@ -140,10 +140,11 @@</div><div> (if (listp slot)</div><div> (second slot)</div><div> slot)))</div><div>- `(symbol-macrolet ,(mapcar (lambda (slot)</div>
<div>- `(,(slot-var slot) (getprop ,object ',(slot-symbol slot))))</div><div>- slots)</div><div>- ,@body)))</div><div>+ (maybe-once-only (object)</div>
<div>+ `(symbol-macrolet ,(mapcar (lambda (slot)</div><div>+ `(,(slot-var slot) (getprop ,object ',(slot-symbol slot))))</div><div>+ slots)</div>
<div>
+ ,@body))))</div><div> </div><div> ;;; multiple values</div><div> </div><div>diff --git a/t/output-tests.lisp b/t/output-tests.lisp</div><div>index 361cd8b..f2d856c 100644</div><div>--- a/t/output-tests.lisp</div>
<div>+++ b/t/output-tests.lisp</div><div>@@ -141,6 +141,13 @@</div><div> (+ a b c))</div><div> "this.a + this.b + this.c;")</div><div> </div><div>+(test-ps-js with-slots-single-eval</div><div>+ (lambda () (with-slots (a b) (foo) (+ a b)))</div>
<div>+ "(function () {</div><div>+ var object1 = foo();</div><div>+ return object1.a + object1.b;</div><div>+});")</div><div>+</div><div> (test-ps-js object-literal-quoted-symbols</div><div> (create 'test "bang" 'symbol-saved-my-life "parenscript")</div>
<div> "({ 'test' : 'bang', 'symbolSavedMyLife' : 'parenscript' });")</div></div><div><br></div><div> </div><div><br></div>