(var (tmp (property ,(convert object) (call |xstring| ,(convert key)))))
,@(mapcar (lambda (key)
`(progn
- (if (=== tmp undefined) (return ,(convert nil)))
+ (if (=== tmp undefined) (return undefined))
(= tmp (property tmp (call |xstring| ,(convert key))))))
keys))
- (return (if (=== tmp undefined) ,(convert nil) tmp))))
+ (return tmp)))
(define-raw-builtin oset* (value object key &rest keys)
(let ((keys (cons key keys)))
(if (=== ,(convert object) undefined)
(throw "Impossible to set object property."))))
(butlast keys))
- (var (tmp
- (= (property obj (call |xstring| ,(convert (car (last keys)))))
- ,(convert value))))
- (return (if (=== tmp undefined)
- ,(convert nil)
- tmp))))))
+ (return (= (property obj (call |xstring| ,(convert (car (last keys)))))
+ ,(convert value)))))))
(define-raw-builtin oget (object key &rest keys)
`(call |js_to_lisp| ,(convert `(oget* ,object ,key ,@keys))))