Backed out changeset da7ad37975f1 (bug 1377016) on suspicion of frequently asserting at dom/script/ScriptLoader.cpp:649 during wpt instantiation-error-2.html. r=backout

This commit is contained in:
Sebastian Hengst 2017-07-22 11:08:53 +02:00
parent cc27374338
commit a5b5831097

View File

@ -569,13 +569,10 @@ JSCompartment::getOrCreateNonSyntacticLexicalEnvironment(JSContext* cx, HandleOb
return nullptr;
}
// If a wrapped WithEnvironmentObject was passed in, unwrap it, as we may
// be creating different WithEnvironmentObject wrappers each time.
RootedObject key(cx, enclosing);
if (enclosing->is<WithEnvironmentObject>()) {
MOZ_ASSERT(!enclosing->as<WithEnvironmentObject>().isSyntactic());
key = &enclosing->as<WithEnvironmentObject>().object();
}
// The key is the unwrapped dynamic scope, as we may be creating different
// WithEnvironmentObject wrappers each time.
MOZ_ASSERT(!enclosing->as<WithEnvironmentObject>().isSyntactic());
RootedObject key(cx, &enclosing->as<WithEnvironmentObject>().object());
RootedObject lexicalEnv(cx, nonSyntacticLexicalEnvironments_->lookup(key));
if (!lexicalEnv) {
@ -594,13 +591,9 @@ JSCompartment::getNonSyntacticLexicalEnvironment(JSObject* enclosing) const
{
if (!nonSyntacticLexicalEnvironments_)
return nullptr;
// If a wrapped WithEnvironmentObject was passed in, unwrap it as in
// getOrCreateNonSyntacticLexicalEnvironment.
JSObject* key = enclosing;
if (enclosing->is<WithEnvironmentObject>()) {
MOZ_ASSERT(!enclosing->as<WithEnvironmentObject>().isSyntactic());
key = &enclosing->as<WithEnvironmentObject>().object();
}
if (!enclosing->is<WithEnvironmentObject>())
return nullptr;
JSObject* key = &enclosing->as<WithEnvironmentObject>().object();
JSObject* lexicalEnv = nonSyntacticLexicalEnvironments_->lookup(key);
if (!lexicalEnv)
return nullptr;