From a176a0e5f2a347de47958a1fb1fe2538a7e50ccc Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Fri, 3 Jan 2020 22:20:36 -0500 Subject: [PATCH] Bug 1351979 - Change CustomElementRegistry::Define code to properly propagate out JS exceptions; Tag UXP Issue #1344 --- dom/base/CustomElementRegistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 1ab566e1de..d8ca7ade20 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -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.