summaryrefslogtreecommitdiffstats
path: root/dom/base/CustomElementRegistry.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-05 18:38:55 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:31 -0500
commit4dda3f6039c4432a3545986ebc698a725c6c057c (patch)
tree491c34302e208c1cf52604949fa85eaf828d8bc6 /dom/base/CustomElementRegistry.cpp
parent6ec385fbdb2523fb2876055a054ba1cdf6916784 (diff)
downloadUXP-4dda3f6039c4432a3545986ebc698a725c6c057c.tar
UXP-4dda3f6039c4432a3545986ebc698a725c6c057c.tar.gz
UXP-4dda3f6039c4432a3545986ebc698a725c6c057c.tar.lz
UXP-4dda3f6039c4432a3545986ebc698a725c6c057c.tar.xz
UXP-4dda3f6039c4432a3545986ebc698a725c6c057c.zip
Bug 1406297 - Fix Document.createElement must report an exception.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/CustomElementRegistry.cpp')
-rw-r--r--dom/base/CustomElementRegistry.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index bad100cf5..7fd295201 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -111,13 +111,11 @@ CustomElementConstructor::Construct(const char* aExecutionReason,
JS::Rooted<JSObject*> result(cx);
JS::Rooted<JS::Value> constructor(cx, JS::ObjectValue(*mCallback));
if (!JS::Construct(cx, constructor, JS::HandleValueArray::empty(), &result)) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
RefPtr<Element> element;
if (NS_FAILED(UNWRAP_OBJECT(Element, &result, element))) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
@@ -894,7 +892,7 @@ DoUpgrade(Element* aElement,
return;
}
- if (constructResult.get() != aElement) {
+ if (!constructResult || constructResult.get() != aElement) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}