Closed
Bug 632027
Opened 13 years ago
Closed 12 years ago
Reflect.parse: ArrayExpression elements that are SequenceExpressions are discarded
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: jorendorff, Assigned: dherman)
Details
Attachments
(1 file)
4.43 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
js> Reflect.parse("[0, (1,2)]", {loc:0}).body[0].expression.elements [{loc:null, type:"Literal", value:0}, ,]
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: general → dherman
Attachment #653423 -
Flags: review?(jorendorff)
Comment 2•12 years ago
|
||
Related Esprima bugs: http://code.google.com/p/esprima/issues/detail?id=321 http://code.google.com/p/esprima/issues/detail?id=322
Reporter | ||
Comment 3•12 years ago
|
||
Comment on attachment 653423 [details] [diff] [review] fixes handling of array holes Review of attachment 653423 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsreflect.cpp @@ +2921,5 @@ > if (!elts.reserve(pn->pn_count)) > return false; > > for (ParseNode *next = pn->pn_head; next; next = next->pn_next) { > + /* Comma expressions can't occur inside patterns, so no need to test pn_count. */ Heh. Logic is good. Logic and a JS_ASSERT is better. ::: js/src/tests/js1_8_5/extensions/reflect-parse.js @@ +333,5 @@ > assertExpr("[,,,1,2,3,]", arrExpr([,,,lit(1),lit(2),lit(3),])); > assertExpr("[,,,1,2,3,,]", arrExpr([,,,lit(1),lit(2),lit(3),,])); > assertExpr("[,,,1,2,3,,,]", arrExpr([,,,lit(1),lit(2),lit(3),,,])); > assertExpr("[,,,,,]", arrExpr([,,,,,])); > +assertExpr("[,,,,,]", arrExpr([null,null,null,null,null])); You meant to remove the previous one, right? In fact, shouldn't all these change to have nulls in the expected result?
Attachment #653423 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 4•12 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/67ff83142ba5
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/67ff83142ba5
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•