mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 01:55:44 +00:00
Bug 490339 - Unexpected ReferenceError when using "new Function()" (r=mrbkap).
This commit is contained in:
parent
dbf7bafea1
commit
cbf6351cc3
@ -2089,25 +2089,23 @@ 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 {
|
||||
/*
|
||||
* NB: afunbox->level is the static level of
|
||||
* the definition or expression of the function
|
||||
* parsed into afunbox, not the static level of
|
||||
* its body. Therefore we must add 1 to match
|
||||
* lexdep's level to find the afunbox whose
|
||||
* body contains the lexdep definition.
|
||||
*/
|
||||
if (afunbox->level + 1U == lexdepLevel) {
|
||||
afunbox->tcflags |= TCF_FUN_HEAVYWEIGHT;
|
||||
break;
|
||||
}
|
||||
} while ((afunbox = afunbox->parent) != NULL);
|
||||
while (afunbox) {
|
||||
/*
|
||||
* NB: afunbox->level is the static level of
|
||||
* the definition or expression of the function
|
||||
* parsed into afunbox, not the static level of
|
||||
* its body. Therefore we must add 1 to match
|
||||
* lexdep's level to find the afunbox whose
|
||||
* body contains the lexdep definition.
|
||||
*/
|
||||
if (afunbox->level + 1U == lexdepLevel) {
|
||||
afunbox->tcflags |= TCF_FUN_HEAVYWEIGHT;
|
||||
break;
|
||||
}
|
||||
afunbox = afunbox->parent;
|
||||
}
|
||||
if (!afunbox && (tcflags & TCF_IN_FUNCTION))
|
||||
tcflags |= TCF_FUN_HEAVYWEIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user