Closed
Bug 880447
Opened 12 years ago
Closed 11 years ago
Permit 'yield yield expr;'
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(1 file)
1.50 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
We throw:
js> function f() { yield yield 1; }
typein:1:21 SyntaxError: missing ; before statement:
typein:1:21 function f() { yield yield 1; }
Though if you put in some extra parens, there's nothing wrong with it:
js> function f() { yield (yield 1); }
js> dis(f)
...
00001: one
00002: yield
00003: yield
00004: pop
00005: stop
More to the point, ES6 says it's ok:
AssignmentExpression : YieldExpression
YieldExpression : yield *_opt AssignmentExpression
(The optional * is covered by bug 666396.)
Assignee | ||
Comment 1•11 years ago
|
||
I was in the neighborhood.
Assignee: general → jorendorff
Attachment #765675 -
Flags: review?(ejpbruel)
Comment 2•11 years ago
|
||
Comment on attachment 765675 [details] [diff] [review]
v1
Review of attachment 765675 [details] [diff] [review]:
-----------------------------------------------------------------
I'm confident my knowledge of the parser is sufficient for this. (Or, just my ability to read code, really.)
Attachment #765675 -
Flags: review?(ejpbruel) → review+
Comment 3•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•