зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1023686
- Fix JSOP of definition nodes of non-hoisted declarations. (r=luke)
This commit is contained in:
Родитель
17e3efade0
Коммит
723812d679
|
@ -3061,7 +3061,7 @@ EmitDestructuringLHS(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn,
|
|||
} else if (emitOption == PushInitialValues) {
|
||||
// The lhs is a simple name so the to-be-destructured value is
|
||||
// its initial value and there is nothing to do.
|
||||
JS_ASSERT(pn->getOp() == JSOP_GETLOCAL);
|
||||
JS_ASSERT(pn->getOp() == JSOP_SETLOCAL);
|
||||
JS_ASSERT(pn->pn_dflags & PND_BOUND);
|
||||
} else {
|
||||
switch (pn->getKind()) {
|
||||
|
|
|
@ -150,7 +150,7 @@ ParseContext<FullParseHandler>::define(TokenStream &ts,
|
|||
switch (kind) {
|
||||
case Definition::ARG:
|
||||
JS_ASSERT(sc->isFunctionBox());
|
||||
dn->setOp(JSOP_GETARG);
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETARG : JSOP_GETARG);
|
||||
dn->pn_dflags |= PND_BOUND;
|
||||
if (!dn->pn_cookie.set(ts, staticLevel, args_.length()))
|
||||
return false;
|
||||
|
@ -169,7 +169,7 @@ ParseContext<FullParseHandler>::define(TokenStream &ts,
|
|||
case Definition::CONST:
|
||||
case Definition::VAR:
|
||||
if (sc->isFunctionBox()) {
|
||||
dn->setOp(JSOP_GETLOCAL);
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETLOCAL : JSOP_GETLOCAL);
|
||||
dn->pn_dflags |= PND_BOUND;
|
||||
if (!dn->pn_cookie.set(ts, staticLevel, vars_.length()))
|
||||
return false;
|
||||
|
@ -185,7 +185,7 @@ ParseContext<FullParseHandler>::define(TokenStream &ts,
|
|||
break;
|
||||
|
||||
case Definition::LET:
|
||||
dn->setOp(JSOP_GETLOCAL);
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETLOCAL : JSOP_GETLOCAL);
|
||||
dn->pn_dflags |= (PND_LET | PND_BOUND);
|
||||
JS_ASSERT(dn->pn_cookie.level() == staticLevel); /* see bindLet */
|
||||
if (!decls_.addShadow(name, dn))
|
||||
|
|
Загрузка…
Ссылка в новой задаче