(js-format "~a" (js-escape-string form)))
((symbolp form)
(case form
- (true (js-format "true"))
- (false (js-format "false"))
- (null (js-format "null"))
- (this (js-format "this"))
+ (true (js-format "true"))
+ (false (js-format "false"))
+ (null (js-format "null"))
+ (this (js-format "this"))
+ (undefined (js-format "undefined"))
(otherwise
(js-identifier form))))
(t
(unless (or (symbolp x)
(nth-value 1 (valid-js-identifier x))
(and (consp x)
- (member (car x) '(get =))))
+ (member (car x) '(get = property))))
(error "Bad Javascript lvalue ~S" x)))
;;; Process the Javascript AST to reduce some syntax sugar.
(js-expr operand)))))
(js-format ")"))
;; Accessors
+ (property
+ (js-expr (car args))
+ (js-format "[")
+ (js-expr (cadr args))
+ (js-format "]"))
(get
(multiple-value-bind (identifier identifierp)
(valid-js-identifier (car args))