Closed Bug 352197 Opened 19 years ago Closed 19 years ago

"yield" after "return value" does not cause an error if the "return" is in a block

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

Details

(Keywords: testcase, verified1.8.1)

Attachments

(2 files)

js> gen = function() { { return 5; } yield 3; } function () { return 5; yield 3; } It should have rejected the function, saying "anonymous generator function returns a value". If I pass the decompilation back to the compiler, it does reject it.
Attached patch fixSplinter Review
One-line fix. This fixes a long-standing bug in the strict warning for return e; vs. return: function f() { if (x) return y; } would get a warning, but function f() { if (x) { return y; } } would not. /be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #237789 - Flags: review?(mrbkap)
Attachment #237789 - Flags: approval1.8.1?
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
Attached patch the right fixSplinter Review
Thanks to mrbkap for pointing out the obvious. /be
Attachment #237824 - Flags: review?(mrbkap)
Attachment #237824 - Flags: review?(mrbkap) → review+
Attachment #237824 - Flags: approval1.8.1?
Fixed on trunk, already. /be
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 237824 [details] [diff] [review] the right fix a=schrep
Attachment #237824 - Flags: approval1.8.1? → approval1.8.1+
Attachment #237789 - Flags: approval1.8.1?
Fixed on the 1.8 branch. /be
Keywords: fixed1.8.1
Checking in js1_5/Regress/regress-352197.js; /cvsroot/mozilla/js/tests/js1_5/Regress/regress-352197.js,v <-- regress-352197.js initial revision: 1.1 done RCS file: /cvsroot/mozilla/js/tests/js1_7/geniter/regress-352197.js,v done Checking in js1_7/geniter/regress-352197.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-352197.js,v <-- regress-352197.js initial revision: 1.1 done
Flags: in-testsuite+
verified fixed 1.8 20060914 windows/linux 1.9 20060914 windows/mac*/linux
Status: RESOLVED → VERIFIED
Attachment #237789 - Flags: review?(mrbkap)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: