From: Olof-Joachim Frahm Date: Thu, 6 Jun 2013 23:42:32 +0000 (+0200) Subject: Fix return value of OSET. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=d210b7307f20daad1bfd5171a513ed173bd6d938;p=jscl.git Fix return value of OSET. --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 02a3d43..15379f7 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1326,7 +1326,8 @@ "obj = obj[xstring(" (ls-compile key) ")];" "if (obj === undefined) throw 'Impossible to set Javascript property.';" *newline*) (butlast keys)) - "obj[xstring(" (ls-compile (car (last keys))) ")] = " (ls-compile value) ";" *newline*))) + "var tmp = obj[xstring(" (ls-compile (car (last keys))) ")] = " (ls-compile value) ";" *newline* + "return tmp === undefined? " (ls-compile nil) " : tmp;" *newline*))) (define-raw-builtin oget (object key &rest keys) (code "js_to_lisp(" (ls-compile `(oget* ,object ,key ,@keys)) ")"))