Bug 1511130 - Part I, Backed out changeset faacbb32e16a (Bug 1511130) r=bgrins

My approach in bug 1505957 turned out to be flawed.

Differential Revision: https://phabricator.services.mozilla.com/D13607

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Timothy Guan-tin Chien 2018-12-01 22:28:46 +00:00
parent 5fda010a9b
commit 9d9da75ab4

View File

@ -79,16 +79,7 @@ class UAWidgetsChild extends ActorChild {
Services.scriptloader.loadSubScript(uri, sandbox, "UTF-8");
}
let widget;
try {
widget = new sandbox[widgetName](shadowRoot);
} catch (ex) {
// The widget may have thrown during construction.
// Report the failure and recover by clearing the Shadow DOM.
shadowRoot.innerHTML = "";
Cu.reportError(ex);
return;
}
let widget = new sandbox[widgetName](shadowRoot);
this.widgets.set(aElement, widget);
}
@ -98,14 +89,7 @@ class UAWidgetsChild extends ActorChild {
return;
}
if (typeof widget.wrappedJSObject.destructor == "function") {
try {
widget.wrappedJSObject.destructor();
} catch (ex) {
// The widget may have thrown during destruction.
// Report the failure and recover by clearing the Shadow DOM.
aElement.openOrClosedShadowRoot.innerHTML = "";
Cu.reportError(ex);
}
widget.wrappedJSObject.destructor();
}
this.widgets.delete(aElement);
}