Bug 490339 - Unexpected ReferenceError when using "new Function()" (r=mrbkap).

This commit is contained in:
Brendan Eich 2009-04-27 14:47:17 -07:00
parent 215627f0fb
commit d07019814f

View File

@ -2089,11 +2089,7 @@ JSCompiler::setFunctionKinds(JSFunctionBox *funbox, uint16& tcflags)
JSFunctionBox *afunbox = funbox->parent;
uintN lexdepLevel = lexdep->frameLevel();
if (!afunbox) {
if (tcflags & TCF_IN_FUNCTION)
tcflags |= TCF_FUN_HEAVYWEIGHT;
} else {
do {
while (afunbox) {
/*
* NB: afunbox->level is the static level of
* the definition or expression of the function
@ -2106,8 +2102,10 @@ JSCompiler::setFunctionKinds(JSFunctionBox *funbox, uint16& tcflags)
afunbox->tcflags |= TCF_FUN_HEAVYWEIGHT;
break;
}
} while ((afunbox = afunbox->parent) != NULL);
afunbox = afunbox->parent;
}
if (!afunbox && (tcflags & TCF_IN_FUNCTION))
tcflags |= TCF_FUN_HEAVYWEIGHT;
}
}
}