Closed
Bug 920747
Opened 11 years ago
Closed 9 years ago
Reflect.parse incorrectly shows let VariableDeclarations as kind = "var"
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 589199
People
(Reporter: anton, Unassigned)
Details
STP:
1. Open Scratchpad, enter "let a = {};"
2. Press Pretty Print
3. let is now var.
This is pretty bad because it will introduce subtle bugs in other people's code.
Comment 1•11 years ago
|
||
This is actually a bug with Reflect.parse. If you do Reflect.parse("let x = 10") you'll get a VariableDeclaration AST now with kind "var". Interestingly, it works correctly with "const"...just not let.
Summary: Pretty Print changes let to var → Reflect.parse incorrectly shows let VariableDeclarations as kind = "var"
Updated•11 years ago
|
Component: Developer Tools: Scratchpad → JavaScript Engine
Product: Firefox → Core
Updated•11 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 2•11 years ago
|
||
frontend/Parser.cpp at ll. 3631-3641 seem to be relevant here -> "let" at top-level is converted to "var".
Comment 3•11 years ago
|
||
I can confirm that `Reflect.parse("{ let x }")` does the right thing.
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•