Closed
Bug 901987
Opened 12 years ago
Closed 11 years ago
for-of loops do not accept initialisers and are restricted to assignment expressions
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: anba, Assigned: wingo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.93 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
The following for-of loops should both throw a SyntaxError:
---
for (var v=0 of [1]) print(v)
for (var v of [1],[2],[3]) print(v)
---
(1) for-of loops do not accept an initialiser expression
(2) for-of loops only allow assignment expressions as their RHS
Reporter | ||
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8388411 -
Flags: review?(jorendorff)
Assignee | ||
Updated•11 years ago
|
Assignee: general → wingo
Assignee | ||
Comment 3•11 years ago
|
||
I should note that the first part of this bug is already fixed and tested by jit-test for-of/syntax-3.js.
Comment 4•11 years ago
|
||
Comment on attachment 8388411 [details] [diff] [review]
The RHS of a for-of loop is an assignment expression
Review of attachment 8388411 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks.
Attachment #8388411 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Flags: in-testsuite+
Comment 6•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•