X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler-codegen.lisp;h=6a3abc9d4012d1418e4b79f4a3fd24c1dbd82f72;hb=c1243ebc6aaa93fe370ddedbe4bbe1642f0b13e9;hp=61aeac2a385b628625127f2342e4c325811bfcc2;hpb=5174d9250a918896a8505fcd18f9960a3ea634ec;p=jscl.git diff --git a/src/compiler-codegen.lisp b/src/compiler-codegen.lisp index 61aeac2..6a3abc9 100644 --- a/src/compiler-codegen.lisp +++ b/src/compiler-codegen.lisp @@ -108,10 +108,11 @@ (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 @@ -160,7 +161,7 @@ (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. @@ -221,7 +222,7 @@ (js-expr (car args)) (js-format "(") (when (cdr args) - (with-operator (13 'left) + (with-operator (12 'left) (js-expr (cadr args)) (dolist (operand (cddr args)) (let ((*js-output* t)) @@ -229,6 +230,11 @@ (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))