mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Bug 1406297 - Fix Document.createElement must report an exception.
Tag UXP Issue #1344
This commit is contained in:
parent
f077bd93a4
commit
e925977c0f
2 changed files with 13 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue