From d210b7307f20daad1bfd5171a513ed173bd6d938 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Fri, 7 Jun 2013 01:42:32 +0200 Subject: [PATCH] Fix return value of OSET. --- src/compiler.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) ")")) -- 1.7.10.4