mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 490339 - Unexpected ReferenceError when using "new Function()" (r=mrbkap).
This commit is contained in:
parent
9188f47f3a
commit
040f6baa77
@ -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