Closed Bug 880447 Opened 12 years ago Closed 11 years ago

Permit 'yield yield expr;'

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

Attachments

(1 file)

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.)
Attached patch v1Splinter Review
I was in the neighborhood.
Assignee: general → jorendorff
Attachment #765675 - Flags: review?(ejpbruel)
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+
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.

Attachment

General

Created:
Updated:
Size: