Closed Bug 1100441 Opened 10 years ago Closed 8 years ago

"yield expression needs to be parenthesized" should not occur for yield statements in a sequence

Categories

(Core :: JavaScript Engine, defect)

33 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1250589

People

(Reporter: kevinb7, Unassigned)

References

()

Details

(Keywords: reproducible, testcase)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.62 Safari/537.36 Steps to reproduce: I tried running the following javascript code: function* add(x,y) { return x + y; } console.log(yield { gen: add(yield { gen: add(1, 2) }, yield { gen: add(3, 4) }) }) Actual results: I get an error in the console that says: "yield expression must be parenthesized" Expected results: No error. Sequences are supposed to have higher precedence so the given expression should parse without error. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All
See Also: → 1250589
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.