ES6 B.3.4: FunctionDeclaration in IfStatement parsed incorrectly
Offen
parsing
test262
- Vorherrschende Sprache
- Rust
- Sterne
- 22.3k
- Forks
- 1.9k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
[§ 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
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.