Bug 1299519.

This commit is contained in:
Pale Moon
2016-11-16 17:57:05 +01:00
committed by roytam1
parent b4302296bc
commit c97017cd57
2 changed files with 18 additions and 2 deletions
+4 -2
View File
@@ -7096,8 +7096,10 @@ Parser<ParseHandler>::generatorComprehensionLambda(GeneratorKind comprehensionKi
* kid and could be removed from pc->sc.
*/
genFunbox->anyCxFlags = outerpc->sc->anyCxFlags;
if (outerpc->sc->isFunctionBox())
genFunbox->funCxFlags = outerpc->sc->asFunctionBox()->funCxFlags;
if (outerpc->sc->isFunctionBox()) {
genFunbox->funCxFlags =
outerpc->sc->asFunctionBox()->flagsForNestedGeneratorComprehensionLambda();
}
MOZ_ASSERT(genFunbox->generatorKind() == comprehensionKind);
genFunbox->inGenexpLambda = true;
+14
View File
@@ -126,6 +126,16 @@ class FunctionContextFlags
//
bool definitelyNeedsArgsObj:1;
FunctionContextFlags flagsForNestedGeneratorComprehensionLambda() const {
FunctionContextFlags flags;
flags.mightAliasLocals = mightAliasLocals;
flags.hasExtensibleScope = false;
flags.needsDeclEnvObject = false;
flags.argumentsHasLocalBinding = false;
flags.definitelyNeedsArgsObj = false;
return flags;
}
public:
FunctionContextFlags()
: mightAliasLocals(false),
@@ -299,6 +309,10 @@ class FunctionBox : public ObjectBox, public SharedContext
void setDefinitelyNeedsArgsObj() { MOZ_ASSERT(funCxFlags.argumentsHasLocalBinding);
funCxFlags.definitelyNeedsArgsObj = true; }
FunctionContextFlags flagsForNestedGeneratorComprehensionLambda() const {
return funCxFlags.flagsForNestedGeneratorComprehensionLambda();
}
bool hasDefaults() const {
return length != function()->nargs() - function()->hasRest();
}