From 16cd53bd8d53441cd0829298ddf43b15ba5fa3a8 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Fri, 3 Jan 2020 22:20:36 -0500 Subject: 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(-) (limited to 'dom') diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 1ab566e1d..d8ca7ade2 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. -- cgit v1.2.3