зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1126754 - Correctly note new pn_tail; factor out ParseNode::prepend (r=jandem)
--HG-- extra : rebase_source : 29a9a9b1e81e218d0abd353a71b08ad972d5b084
This commit is contained in:
Родитель
493c1655a1
Коммит
83379dd84d
|
@ -382,10 +382,7 @@ class FullParseHandler
|
||||||
if (!initialYield)
|
if (!initialYield)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
initialYield->pn_next = stmtList->pn_head;
|
stmtList->prepend(initialYield);
|
||||||
stmtList->pn_head = initialYield;
|
|
||||||
stmtList->pn_count++;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -848,6 +848,15 @@ class ParseNode
|
||||||
pn_count++;
|
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()
|
void checkListConsistency()
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -2253,11 +2253,7 @@ Parser<FullParseHandler>::finishFunctionDefinition(ParseNode *pn, FunctionBox *f
|
||||||
if (!item)
|
if (!item)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
item->pn_next = body->pn_head;
|
body->prepend(item);
|
||||||
body->pn_head = item;
|
|
||||||
if (body->pn_tail == &body->pn_head)
|
|
||||||
body->pn_tail = &item->pn_next;
|
|
||||||
++body->pn_count;
|
|
||||||
body->pn_xflags |= PNX_DESTRUCT;
|
body->pn_xflags |= PNX_DESTRUCT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// |jit-test| error:SyntaxError
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
with ({}) {}
|
||||||
|
function f() {
|
||||||
|
({ *h(){} })
|
||||||
|
}
|
||||||
|
function f
|
||||||
|
})()
|
Загрузка…
Ссылка в новой задаче