(if (and (>= js2-language-version 200)
(js2-match-token js2-FOR))
(js2-parse-generator-comp px-pos)
- (let* ((expr (js2-parse-expr))
+ (let* ((js2-in-for-init nil)
+ (expr (js2-parse-expr))
(pn (make-js2-paren-node :pos px-pos
:expr expr
:len (- (js2-current-token-end)
c-pos)
(when (js2-match-token js2-HOOK)
(setq q-pos (- (js2-current-token-beg) pos)
- if-true (js2-parse-assign-expr))
+ if-true (let (js2-in-for-init) (js2-parse-assign-expr)))
(js2-must-match js2-COLON "msg.no.colon.cond")
(setq c-pos (- (js2-current-token-beg) pos)
if-false (js2-parse-assign-expr)
(js2-deftest-parse parenthesized-expression
"(1 + 2);")
+(js2-deftest-parse for-with-in-operator-in-parens
+ "for (var y = (0 in []) in {}) {\n}")
+
+(js2-deftest-parse for-with-in-operator-in-cond
+ "for (var y = 1 ? 0 in [] : false in {}) {\n}")
+
;;; Callers of `js2-valid-prop-name-token'
(js2-deftest-parse parse-property-access-when-not-keyword