Bug 1393806 part 3. Change dom::ReparentWrapper to take an ErrorResult. r=peterv
This makes it easier for its consumers to avoid leaving a dangling exception on the JSContext. MozReview-Commit-ID: Xep7IkYxSx
This commit is contained in:
@@ -1724,7 +1724,7 @@ nsHTMLDocument::Open(JSContext* cx,
|
||||
JS::Rooted<JSObject*> wrapper(cx, GetWrapper());
|
||||
if (oldScope && newScope != oldScope && wrapper) {
|
||||
JSAutoCompartment ac(cx, wrapper);
|
||||
rv = mozilla::dom::ReparentWrapper(cx, wrapper);
|
||||
mozilla::dom::ReparentWrapper(cx, wrapper, rv);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1735,7 +1735,7 @@ nsHTMLDocument::Open(JSContext* cx,
|
||||
JS::Rooted<JSObject*> contentsOwnerWrapper(cx,
|
||||
mTemplateContentsOwner->GetWrapper());
|
||||
if (contentsOwnerWrapper) {
|
||||
rv = mozilla::dom::ReparentWrapper(cx, contentsOwnerWrapper);
|
||||
mozilla::dom::ReparentWrapper(cx, contentsOwnerWrapper, rv);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user