SyntaxError: missing = in const declaration Firefox 50 SyntaxError: missing = in const declaration Firefox 50 google-chrome google-chrome

SyntaxError: missing = in const declaration Firefox 50


Yes, this appears to be a bug in Firefox. The spec allows the use of const:

IterationStatement:    for(ForDeclaration in Expression) StatementForDeclaration:    LetOrConst ForBindingForBinding:    BindingIdentifier    BindingPattern

(truncated and simplified)

It seems Firefox is incorrectly interpreting ForDeclaration as a LexicalBinding.

Related: ECMAScript 2015: const in for loops

This seems like the bug report for this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1101653 .


Proper let and const is coming to Firefox: https://twitter.com/evilpies/status/768881995912994816