ES6 B.3.4: FunctionDeclaration in IfStatement parsed incorrectly
Aperta
parsing
test262
- Lingua principale
- Rust
- Stelle
- 22.3k
- Fork
- 1.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
[§ B.3.4](http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarations-in-ifstatement-statement-clauses) allows `FunctionDeclaration` to appear in either branch of an `IfStatement` in non-strict mode. In strict mode, they are forbidden on both sides.
Flow incorrectly parses a function in an else branch as `FunctionExpression`.
```
if (false) function f() {} else function g() {}
^^^^^^^^^^^^^^^ FunctionDeclaration, good
^^^^^^^^^^^^^^^ FunctionExpression, wrong
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.