Bug 784608 (part 2) - Remove FunctionBox::level. r=jimb.

--HG--
extra : rebase_source : 0e887c586df02cf84f16816457a6f22e004b34bf
This commit is contained in:
Nicholas Nethercote 2012-08-22 17:25:53 -07:00
parent 47287a3eb0
commit 5ea69a2892
2 changed files with 1 additions and 10 deletions

View File

@ -397,7 +397,6 @@ FunctionBox::FunctionBox(ObjectBox* traceListHead, JSObject *obj, ParseNode *fn,
bindings(),
bufStart(0),
bufEnd(0),
level(pc->staticLevel),
ndefaults(0),
strictModeState(sms),
inWith(!!pc->innermostWith),
@ -4902,16 +4901,10 @@ CompExprTransplanter::transplant(ParseNode *pn)
/*
* Only the first level of transplant recursion through functions needs
* to reparent the funbox, since all descendant functions are correctly
* linked under the top-most funbox. But every visit to this case needs
* to update funbox->level.
*
* Recall that funbox->level is the static level of the code containing
* the definition or expression of the function and not the static level
* of the function's body.
* linked under the top-most funbox.
*/
FunctionBox *funbox = pn->pn_funbox;
funbox->level = pc->staticLevel + funcLevel;
if (++funcLevel == 1 && genexp) {
FunctionBox *parent = pc->sc->funbox();
@ -4923,7 +4916,6 @@ CompExprTransplanter::transplant(ParseNode *pn)
funbox->parent = parent;
funbox->siblings = parent->kids;
parent->kids = funbox;
funbox->level = pc->staticLevel;
}
/* FALL THROUGH */
}

View File

@ -298,7 +298,6 @@ struct FunctionBox : public ObjectBox
Bindings bindings; /* bindings for this function */
size_t bufStart;
size_t bufEnd;
uint16_t level;
uint16_t ndefaults;
StrictMode::StrictModeState strictModeState;
bool inWith:1; /* some enclosing scope is a with-statement