w(yield) should not cause "yield expression must be parenthesized" syntax error

VERIFIED FIXED in mozilla1.9beta4

Status

()

Core
JavaScript Engine
P3
normal
VERIFIED FIXED
11 years ago
2 years ago

People

(Reporter: Jesse Ruderman, Assigned: brendan)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
mozilla1.9beta4
testcase
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9 -
wanted1.9 +
in-testsuite +
in-litmus -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
js> (function() { w(yield); })
typein:1: SyntaxError: yield expression must be parenthesized:
typein:1: (function() { w(yield); })
typein:1: ................^

js> (function() { w((yield)); })
function () {
    w((yield));
}

js> (function() { w(1 ? yield : 0); })
function () {
    w(yield);
}
(Reporter)

Updated

11 years ago
Flags: blocking1.9?

Comment 1

10 years ago
Not worth blocking on?
Flags: blocking1.9?

Updated

10 years ago
Flags: blocking1.9-
(Reporter)

Comment 2

10 years ago
js> (function () { f(x = yield); const x; })
function () {
    f(yield);
    const x;
}

(Assignee)

Comment 3

10 years ago
ES4 is not requiring fully parenthesized yield if the yield expression is the only or last actual parameter. Patch shortly.

/be
Blocks: 380236
(Assignee)

Comment 4

10 years ago
Created attachment 304147 [details] [diff] [review]
relaxed ES4 rules
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #304147 - Flags: review?(mrbkap)
(Assignee)

Updated

10 years ago
Flags: wanted1.9+
OS: Mac OS X → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.9beta4

Updated

10 years ago
Attachment #304147 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 5

10 years ago
I'm not in favor of runtime version checking, so these two tests will have to cope -- unless someone feels strongly that those errors should be thrown for version 1.7. A change in non-error semantics would be a different matter. Just relaxing things to permit what was an error before does not motivate me to spend code size and source complexity on version checks.

/be
(Assignee)

Comment 6

10 years ago
Fixed:

js/src/jsparse.c 3.334

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 7

10 years ago
verified linux|mac|windows

/cvsroot/mozilla/js/tests/js1_8/genexps/regress-384991.js,v  <--  regress-384991.js
initial revision: 1.1
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Flags: in-litmus-
Having this problem in Firefox 45.0.1. Have it been regressed?

Screenshot: http://s18.postimg.org/j8rlroi7t/firefox_yield.png
This is fixed in Firefox 47: bug 1250589.
Thanks for info! One strange thing here is that real error was 'Constructor ... is undefined' which I spotted by Chrome. Once that error was fixed -- yield was gone as well.
Please open a new bug when there is still a problem with Firefox 47 (currently Firefox Developer Edition). Thanks.
I didn't tried in 47. If I will have any problems there, then I will open new one. Thanks.
You need to log in before you can comment on or make changes to this bug.