branch: master
commit 8047d7f172b1dd10475ba0778f029bd0660976e9
Author: Christoph Dittmann <[email protected]>
Commit: Christoph Dittmann <[email protected]>
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 7e5c9d8..74f0ea2 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)