2016-08-19 2 views

答えて

12

はい、これはFirefoxのバグのようです。 spec allows the use of const

IterationStatement: 
    for(ForDeclaration in Expression) Statement 

ForDeclaration: 
    LetOrConst ForBinding 

ForBinding: 
    BindingIdentifier 
    BindingPattern 

(切り捨てと単純化された)

Firefoxが誤っLexicalBindingとしてForDeclarationを解釈しているようです。

関連:https://bugzilla.mozilla.org/show_bug.cgi?id=1101653ECMAScript 2015: const in for loops

これは、この問題のバグレポートのように思えます。


適切letconstは、Firefoxに来ている:スペックを読むときhttps://twitter.com/evilpies/status/768881995912994816

+0

えっ、Firefoxは私が作った同じ間違いをしています。特別な動作のループをチェックするとは思わなかった。 – ssube

関連する問題