Closed Bug 384991 Opened 17 years ago Closed 16 years ago

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

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta4

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase)

Attachments

(1 file)

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);
}
Flags: blocking1.9?
Not worth blocking on?
Flags: blocking1.9?
Flags: blocking1.9-
js> (function () { f(x = yield); const x; })
function () {
    f(yield);
    const x;
}

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

/be
Blocks: js1.8
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #304147 - Flags: review?(mrbkap)
Flags: wanted1.9+
OS: Mac OS X → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.9beta4
Attachment #304147 - Flags: review?(mrbkap) → review+
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
Fixed:

js/src/jsparse.c 3.334

/be
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: