From 8047d7f172b1dd10475ba0778f029bd0660976e9 Mon Sep 17 00:00:00 2001 From: Christoph Dittmann Date: Mon, 30 Nov 2015 10:41:34 +0100 Subject: [PATCH] Recognize for-of and for-in loops with const Declarations in for-of and for-in loops may also be "const". See http://www.ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-bindinginstantiation --- js2-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js2-mode.el b/js2-mode.el index 7e5c9d836..74f0ea2f1 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -8924,7 +8924,7 @@ Last matched token must be js2-FOR." ((= tt js2-SEMI) (js2-unget-token) (setq init (make-js2-empty-expr-node))) - ((or (= tt js2-VAR) (= tt js2-LET)) + ((or (= tt js2-VAR) (= tt js2-LET) (= tt js2-CONST)) (setq init (js2-parse-variables tt (js2-current-token-beg)))) (t (js2-unget-token) -- 2.39.2