Bug 1351979 - Change CustomElementRegistry::Define code to properly propagate out JS exceptions;

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-03 22:20:36 -05:00 committed by Roy Tam
commit a176a0e5f2

View file

@ -745,7 +745,7 @@ CustomElementRegistry::Define(const nsAString& aName,
// here.
JS::RootedValue rootedv(cx, JS::ObjectValue(*constructorProtoUnwrapped));
if (!JS_WrapValue(cx, &rootedv) || !callbacksHolder->Init(cx, rootedv)) {
aRv.Throw(NS_ERROR_FAILURE);
aRv.StealExceptionFromJSContext(cx);
return;
}
} // Leave constructorProtoUnwrapped's compartment.