Fix SETF for OGET aka OSET.
authorOlof-Joachim Frahm <olof@macrolet.net>
Wed, 12 Jun 2013 20:17:57 +0000 (22:17 +0200)
committerOlof-Joachim Frahm <olof@macrolet.net>
Wed, 12 Jun 2013 20:27:45 +0000 (22:27 +0200)
src/compiler.lisp

index c988050..071873d 100644 (file)
   (js!selfcall
     "var tmp = (" (ls-compile object) ")[xstring(" (ls-compile key) ")];" *newline*
     (mapconcat (lambda (key)
-                 (code "if (tmp === undefined) return " (ls-compile nil) ";" *newline*)
-                 (code "tmp = tmp[xstring(" (ls-compile key) ")];" *newline*))
+                 (code "if (tmp === undefined) return " (ls-compile nil) ";" *newline*
+                       "tmp = tmp[xstring(" (ls-compile key) ")];" *newline*))
                keys)
     "return tmp === undefined? " (ls-compile nil) " : tmp;" *newline*))
 
     (js!selfcall
       "var obj = " (ls-compile object) ";" *newline*
       (mapconcat (lambda (key)
-                   "obj = obj[xstring(" (ls-compile key) ")];"
-                   "if (obj === undefined) throw 'Impossible to set Javascript property.';" *newline*)
+                   (code "obj = obj[xstring(" (ls-compile key) ")];"
+                         "if (obj === undefined) throw 'Impossible to set Javascript property.';" *newline*))
                  (butlast keys))
       "var tmp = obj[xstring(" (ls-compile (car (last keys))) ")] = " (ls-compile value) ";" *newline*
       "return tmp === undefined? " (ls-compile nil) " : tmp;" *newline*)))