Closed
Bug 1863308
Opened 11 months ago
Closed 10 months ago
Confusing error when using `case` as a variable name in for loop initializer
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
122 Branch
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: emilio, Assigned: jon4t4n)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
for (let case of ["removed", "changed"]) {}
Says:
Uncaught SyntaxError: missing ; after for-loop initializer
Which was very confusing until I realized case
is a JS keyword.
V8 says:
Uncaught SyntaxError: Unexpected token 'case'
Which is a bit less confusing.
Reporter | ||
Updated•11 months ago
|
Type: task → defect
Updated•11 months ago
|
Assignee | ||
Comment 1•10 months ago
|
||
Updated•10 months ago
|
Assignee: nobody → jonatan.r.klemets
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/6d8cf3ece335
Improve error message when using reserved word in `for (let ...)` r=arai
Comment 3•10 months ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
status-firefox122:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•