Closed Bug 802155 Opened 13 years ago Closed 13 years ago

Reflect.parse should handle for-of comprehension correctly

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: utatane.tea, Unassigned)

Details

(Whiteboard: [js:p2])

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 Steps to reproduce: Compared Reflect.parse('[x for (x in [])]') and Reflect.parse('[x for (x of [])]') Actual results: They are the same. Expected results: Reflect.parse should handle for-of comprehension correctly.
I suggest adding of flag to ComprehensionBlock.
Attached patch rev1 patch (obsolete) — Splinter Review
Attached rev1 patch. This patch changes builder.comprehensionBlock & ComprehensionBlock interface.
Attachment #671862 - Flags: review?(jorendorff)
Attachment #671862 - Attachment is patch: true
I've opened the same issue to Esprima. http://code.google.com/p/esprima/issues/detail?id=359
Comment on attachment 671862 [details] [diff] [review] rev1 patch Review of attachment 671862 [details] [diff] [review]: ----------------------------------------------------------------- The only thing missing here is a test. See js/src/tests/js1_8_5/extensions/reflect-parse.js and search for comprehensions. Clearing the review flag. Please set it r?me again if you post a new patch. Sorry for the very slow review here. I've been out a bit.
Attachment #671862 - Flags: review?(jorendorff)
Attached patch rev2 patchSplinter Review
(In reply to Jason Orendorff [:jorendorff] from comment #4) Thanks for your review. I've just attached revised patch that contains test cases.
Attachment #671862 - Attachment is obsolete: true
Attachment #677284 - Flags: review?(jorendorff)
Comment on attachment 677284 [details] [diff] [review] rev2 patch Review of attachment 677284 [details] [diff] [review]: ----------------------------------------------------------------- I'll push this Monday. ::: js/src/tests/js1_8_5/extensions/reflect-parse.js @@ +836,5 @@ > + genExpr(arrExpr([ident("x"), ident("y")]), [compOfBlock(ident("x"), ident("foo")), compOfBlock(ident("y"), ident("bar"))], ident("p"))); > +assertExpr("( [x,y,z] for (x of foo) for (y of bar) for (z of baz) if (p) )", > + genExpr(arrExpr([ident("x"), ident("y"), ident("z")]), > + [compOfBlock(ident("x"), ident("foo")), compOfBlock(ident("y"), ident("bar")), compOfBlock(ident("z"), ident("baz"))], > + ident("p"))); Thanks.
Attachment #677284 - Flags: review?(jorendorff) → review+
Whiteboard: [js:p2]
Completely forgot about this. Found it in my queue and pushed it today. https://hg.mozilla.org/integration/mozilla-inbound/rev/b7fd23ced4ee
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: