Bug 489034 - let declaration getting lost in certain situations (r=mrbkap).

This commit is contained in:
Brendan Eich 2009-05-15 15:32:57 -07:00
parent a250100e3c
commit 51dd82a552

View File

@ -2125,7 +2125,8 @@ JSCompiler::setFunctionKinds(JSFunctionBox *funbox, uint16& tcflags)
* lexdep's level to find the afunbox whose
* body contains the lexdep definition.
*/
if (afunbox->level + 1U == lexdepLevel) {
if (afunbox->level + 1U == lexdepLevel ||
(lexdepLevel == 0 && lexdep->isLet())) {
afunbox->tcflags |= TCF_FUN_HEAVYWEIGHT;
break;
}