Closed Bug 351514 Opened 18 years ago Closed 18 years ago

Finalize yield syntax to match ES4/JS2 proposal

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: brendan, Assigned: brendan)

References

Details

(Keywords: verified1.8.1)

Attachments

(3 files, 1 obsolete file)

This tracks Python 2.5. Currently we allow function f() { yield g(yield 1, 2) } but the inner yield must be parenthesized, per PEP 342, Python 2.5, and the ES4 / JS2 proposal. Trivial patch next. /be
Attached patch fixSplinter Review
Attachment #236932 - Flags: review?(mrbkap)
This is important to get right in js1.7/mozilla1.8.1/firefox2 -- we don't want to be hobbled with a compatibility requirement down the road based on js1.7 supported unparenthesized yield expressions as actual arguments. /be
Status: NEW → ASSIGNED
Flags: blocking1.8.1?
Priority: -- → P1
Target Milestone: --- → mozilla1.8.1
Attachment #236932 - Flags: review?(mrbkap) → review+
Flags: blocking1.8.1? → blocking1.8.1+
Comment on attachment 236932 [details] [diff] [review] fix This is safe, it merely adds a more specific error, registerizes PN_LAST(pn) in pn2 in the existing bad-yield-syntax case, and adds identical error test-and-report code to the ArgumentList parser. /be
Attachment #236932 - Flags: approval1.8.1?
Fixed on trunk. /be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #236932 - Flags: approval1.8.1?
Attachment #237043 - Flags: review+
Attachment #237043 - Flags: approval1.8.1?
Checking in regress-351514.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-351514.js,v <-- regress-351514.js initial revision: 1.1
Flags: in-testsuite+
Comment on attachment 237043 [details] [diff] [review] fix for 1.8 branch a=beltzner on behalf of 181drivers
Attachment #237043 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8 branch. /be
Keywords: fixed1.8.1
verified fixed 1.9a1_2006090707 windows/mac*/linux
Status: RESOLVED → VERIFIED
verified fixed 1.8 1.9 20060909 windows/mac*/linux
Attachment #238592 - Flags: review?(bclary)
Comment on attachment 238592 [details] [diff] [review] fix js1_7/geniter/regress-345855.js print will try to print to a real printer if this is run in the browser. writeLineToLog() is preferred in non-e4x tests although we _could_ do what e4x does and redefine print. These new values are the correct, non-error producing values? Would the old values cause errors?
Attachment #238592 - Flags: review?(bclary) → review-
Sorry, forgot I added those prints -- it was impossible to tell what was failing before I did that. Maybe the actual and expected values could encode something about the specific test? Anyway, just passing through here. The upshot is that except when used as a statement, and when used on the right hand side of assignment, yield expressions must be parenthesized. Previously accepted under-parenthesized yield (specifically as a single actual parameter to a function, foo(yield bar) e.g.) is not allowed now. /be
The numeric labels were meant to indicate which section failed but I went a head and changed them. This also adds the syntax errors.
Attachment #238592 - Attachment is obsolete: true
Attachment #238595 - Flags: review?(brendan)
Comment on attachment 238595 [details] [diff] [review] fixier js1_7/geniter/regress-345855.js Thanks, works for me. /be
Attachment #238595 - Flags: review?(brendan) → review+
Checking in regress-345855.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-345855.js,v <-- regress-345855.js new revision: 1.2; previous revision: 1.1 done
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: