(push (cons sexp jsvar) *literal-table*)
(toplevel-compilation `(var (,jsvar ,dumped)))
(when (keywordp sexp)
- (toplevel-compilation `(= ,(get jsvar "value") ,jsvar)))
+ (toplevel-compilation `(= (get ,jsvar "value") ,jsvar)))
jsvar)))))))
(eval (cons 'progn body)))
;; `load-toplevel' is given, then just compile the subforms as usual.
(when (find :load-toplevel situations)
- (convert `(progn ,@body))))
+ (convert-toplevel `(progn ,@body) *multiple-value-p*)))
((find :execute situations)
(convert `(progn ,@body) *multiple-value-p*))
(t
,@(mapcar (lambda (key)
`(progn
(= obj (property obj (call |xstring| ,(convert key))))
- (if (=== object undefined)
+ (if (=== obj undefined)
(throw "Impossible to set object property."))))
(butlast keys))
(var (tmp
(define-builtin in (key object)
`(bool (in (call |xstring| ,key) ,object)))
+(define-builtin delete-property (key object)
+ `(selfcall
+ (delete (property ,object (call |xstring| ,key)))))
+
(define-builtin map-for-in (function object)
`(selfcall
(var (f ,function)
(when expandedp
(return-from convert-toplevel (convert-toplevel sexp multiple-value-p))))
;; Process as toplevel
- (let ((*toplevel-compilations* nil))
+ (let ((*convert-level* -1)
+ (*toplevel-compilations* nil))
(cond
;; Non-empty toplevel progn
((and (consp sexp)