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

RESOLVED DUPLICATE of bug 1250589

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 1250589
4 years ago
2 years ago

People

(Reporter: kevinb7, Unassigned)

Tracking

({reproducible, testcase})

33 Branch
reproducible, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

4 years ago
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

Updated

4 years ago
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
Keywords: reproducible, testcase
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All

Updated

2 years ago
See Also: → bug 1250589

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1250589
You need to log in before you can comment on or make changes to this bug.