]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix void parsing
authorJackson Hamilton <jackson@jacksonrayhamilton.com>
Sat, 2 Jan 2016 22:58:17 +0000 (14:58 -0800)
committerJackson Hamilton <jackson@jacksonrayhamilton.com>
Sun, 3 Jan 2016 03:21:26 +0000 (19:21 -0800)
js2-mode.el
tests/parser.el

index f574aee947c0874e744dc421432ef20fa5ce6bfb..85c3ee9659965dd1ae28166cf8c94893ad230339 100644 (file)
@@ -3479,6 +3479,7 @@ The type field inherited from `js2-node' holds the operator."
                (cons js2-INSTANCEOF "instanceof")
                (cons js2-DELPROP "delete")
                (cons js2-AWAIT "await")
+               (cons js2-VOID "void")
                (cons js2-COMMA ",")
                (cons js2-COLON ":")
                (cons js2-OR "||")
@@ -3580,7 +3581,8 @@ property is added if the operator follows the operand."
       (insert op))
     (if (or (= tt js2-TYPEOF)
             (= tt js2-DELPROP)
-            (= tt js2-AWAIT))
+            (= tt js2-AWAIT)
+            (= tt js2-VOID))
         (insert " "))
     (js2-print-ast (js2-unary-node-operand n) 0)
     (when postfix
index 50cb521bab8ea64cfb2b30dfaab813f67b5423d5..520ff45d19fc6d567fb9166d56daf5c7ba1d4cb6 100644 (file)
@@ -126,6 +126,9 @@ the test."
 (js2-deftest-parse let-expression-statement
   "let (x = 42) x;")
 
+(js2-deftest-parse void
+  "void 0;")
+
 ;;; Callers of `js2-valid-prop-name-token'
 
 (js2-deftest-parse parse-property-access-when-not-keyword