Bug 882933 - Copy treatAsRunOnce bit when cloning scripts, don't clone scripts unnecessarily for arrow lambdas, r=luke.

This commit is contained in:
Brian Hackett 2013-06-24 11:24:35 -06:00
parent 128d5f8da8
commit bd5bfb2841
2 changed files with 2 additions and 1 deletions

View File

@ -703,7 +703,7 @@ UseNewTypeForClone(JSFunction *fun)
return true;
if (fun->isArrow())
return true;
return false;
if (fun->hasSingletonType())
return false;

View File

@ -2425,6 +2425,7 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
dst->funNeedsDeclEnvObject = src->funNeedsDeclEnvObject;
dst->funHasAnyAliasedFormal = src->funHasAnyAliasedFormal;
dst->hasSingletons = src->hasSingletons;
dst->treatAsRunOnce = src->treatAsRunOnce;
dst->isGenerator = src->isGenerator;
dst->isGeneratorExp = src->isGeneratorExp;