Closed
Bug 802155
Opened 13 years ago
Closed 13 years ago
Reflect.parse should handle for-of comprehension correctly
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: utatane.tea, Unassigned)
Details
(Whiteboard: [js:p2])
Attachments
(1 file, 1 obsolete file)
9.86 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
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.
Reporter | ||
Comment 1•13 years ago
|
||
I suggest adding of flag to ComprehensionBlock.
Reporter | ||
Comment 2•13 years ago
|
||
Attached rev1 patch.
This patch changes builder.comprehensionBlock & ComprehensionBlock interface.
Attachment #671862 -
Flags: review?(jorendorff)
Reporter | ||
Updated•13 years ago
|
Attachment #671862 -
Attachment is patch: true
Reporter | ||
Comment 3•13 years ago
|
||
I've opened the same issue to Esprima.
http://code.google.com/p/esprima/issues/detail?id=359
Comment 4•13 years ago
|
||
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)
Reporter | ||
Comment 5•13 years ago
|
||
(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 6•13 years ago
|
||
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+
Updated•13 years ago
|
Whiteboard: [js:p2]
Comment 7•13 years ago
|
||
Completely forgot about this. Found it in my queue and pushed it today.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7fd23ced4ee
Comment 8•13 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Reporter | ||
Comment 9•13 years ago
|
||
Thanks!
You need to log in
before you can comment on or make changes to this bug.
Description
•