mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051760 - Fix "Assertion failure: !vp.isMagic(), at jsobj.cpp:4600" with arguments, direct eval, and a destructuring declaration. r=Waldo.
--HG-- extra : rebase_source : 8054e6ed982d32e2a8e2d91cf52093abe589bfd2
This commit is contained in:
parent
c5d1bccdd2
commit
d801cfb035
@ -7329,9 +7329,18 @@ typename ParseHandler::Node
|
||||
Parser<ParseHandler>::computedPropertyName(Node literal)
|
||||
{
|
||||
uint32_t begin = pos().begin;
|
||||
|
||||
// Turn off the inDeclDestructuring flag when parsing computed property
|
||||
// names. In short, when parsing 'let {[x + y]: z} = obj;', noteNameUse()
|
||||
// should be called on x and y, but not on z. See the comment on
|
||||
// Parser<>::checkDestructuring() for details.
|
||||
bool saved = pc->inDeclDestructuring;
|
||||
pc->inDeclDestructuring = false;
|
||||
Node assignNode = assignExpr();
|
||||
pc->inDeclDestructuring = saved;
|
||||
if (!assignNode)
|
||||
return null();
|
||||
|
||||
MUST_MATCH_TOKEN(TOK_RB, JSMSG_COMP_PROP_UNTERM_EXPR);
|
||||
Node propname = handler.newComputedName(assignNode, begin, pos().end);
|
||||
if (!propname)
|
||||
|
4
js/src/jit-test/tests/arguments/bug1051760.js
Normal file
4
js/src/jit-test/tests/arguments/bug1051760.js
Normal file
@ -0,0 +1,4 @@
|
||||
function test() {
|
||||
eval("var { [arguments] : y } = {};");
|
||||
}
|
||||
test();
|
Loading…
Reference in New Issue
Block a user