[bugfix commutative plus and minus Henrik Hjelte **20061115213502] { hunk ./src/js.lisp 1032 - '(+ *))) + '(+ *)) + (js-equal lhs (first (op-args rhs)))) hunk ./src/js.lisp 1038 - :args args-without)))) + :args args-without-first)))) hunk ./t/test.lisp 42 - "x = 'before' + x + 'after';") + "x = 'before' + x + 'after'") + +(test-ps-js plus-works-if-first + (setf x (+ x "middle" "after")) + "x += 'middle' + 'after'") + +(test-ps-js setf-side-effects + (progn + (let ((x 10)) + (defun side-effect() + (setf x 4) + (return 3)) + (setf x (+ 2 (side-effect) x 5)))) + " +var x = 10; +function sideEffect() { + x = 4; + return 3; +}; +x = 2 + sideEffect() + x + 5;") +;; Parenscript used to optimize to much: +;; var x = 10; +;; function sideEffect() { +;; x = 4; +;; return 3; +;; }; +;; x += 2 + sideEffect() + 5; +;; +;; Which is 20, not 14 + }