mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 1126754 - Correctly note new pn_tail; factor out ParseNode::prepend (r=jandem)
--HG-- extra : rebase_source : 29a9a9b1e81e218d0abd353a71b08ad972d5b084
This commit is contained in:
parent
493c1655a1
commit
83379dd84d
@ -382,10 +382,7 @@ class FullParseHandler
|
||||
if (!initialYield)
|
||||
return false;
|
||||
|
||||
initialYield->pn_next = stmtList->pn_head;
|
||||
stmtList->pn_head = initialYield;
|
||||
stmtList->pn_count++;
|
||||
|
||||
stmtList->prepend(initialYield);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -848,6 +848,15 @@ class ParseNode
|
||||
pn_count++;
|
||||
}
|
||||
|
||||
void prepend(ParseNode *pn) {
|
||||
MOZ_ASSERT(pn_arity == PN_LIST);
|
||||
pn->pn_next = pn_head;
|
||||
pn_head = pn;
|
||||
if (pn_tail == &pn_head)
|
||||
pn_tail = &pn->pn_next;
|
||||
pn_count++;
|
||||
}
|
||||
|
||||
void checkListConsistency()
|
||||
#ifndef DEBUG
|
||||
{}
|
||||
|
@ -2253,11 +2253,7 @@ Parser<FullParseHandler>::finishFunctionDefinition(ParseNode *pn, FunctionBox *f
|
||||
if (!item)
|
||||
return false;
|
||||
|
||||
item->pn_next = body->pn_head;
|
||||
body->pn_head = item;
|
||||
if (body->pn_tail == &body->pn_head)
|
||||
body->pn_tail = &item->pn_next;
|
||||
++body->pn_count;
|
||||
body->prepend(item);
|
||||
body->pn_xflags |= PNX_DESTRUCT;
|
||||
}
|
||||
|
||||
|
9
js/src/jit-test/tests/basic/testBug1126754.js
Normal file
9
js/src/jit-test/tests/basic/testBug1126754.js
Normal file
@ -0,0 +1,9 @@
|
||||
// |jit-test| error:SyntaxError
|
||||
|
||||
(function() {
|
||||
with ({}) {}
|
||||
function f() {
|
||||
({ *h(){} })
|
||||
}
|
||||
function f
|
||||
})()
|
Loading…
x
Reference in New Issue
Block a user