Bug 1536556 - Replace raw thrown Cr.ERRORs with Components.Exception. r=mossop,remote-protocol-reviewers,marionette-reviewers,whimboo,necko-reviewers,geckoview-reviewers,valentin,agi

Raw Cr.ERROR don't get stack information, same as throwing JS literals instead
of `new Error()`s.

This was done automatically with a new eslint rule that will be introduced in
the next commit.  One instance of a raw Cr.ERROR was not replaced since it is
used in a test that specifically checks the preservation of raw Cr values in
XPCJS.  The rule will be disabled for that instance.

Differential Revision: https://phabricator.services.mozilla.com/D28073
This commit is contained in:
Ian Moody 2020-05-05 17:41:36 +00:00
parent be41cb6dfb
commit 011b59d595
135 changed files with 285 additions and 285 deletions

View file

@ -6015,7 +6015,7 @@ nsBrowserAccess.prototype = {
openURI(aURI, aOpenWindowInfo, aWhere, aFlags, aTriggeringPrincipal, aCsp) { openURI(aURI, aOpenWindowInfo, aWhere, aFlags, aTriggeringPrincipal, aCsp) {
if (!aURI) { if (!aURI) {
Cu.reportError("openURI should only be called with a valid URI"); Cu.reportError("openURI should only be called with a valid URI");
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
return this.getContentWindowOrOpenURI( return this.getContentWindowOrOpenURI(
aURI, aURI,
@ -6045,7 +6045,7 @@ nsBrowserAccess.prototype = {
"nsBrowserAccess.openURI did not expect aOpenWindowInfo to be " + "nsBrowserAccess.openURI did not expect aOpenWindowInfo to be " +
"passed if the context is OPEN_EXTERNAL." "passed if the context is OPEN_EXTERNAL."
); );
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
if (isExternal && aURI && aURI.schemeIs("chrome")) { if (isExternal && aURI && aURI.schemeIs("chrome")) {

View file

@ -1515,7 +1515,7 @@ class nsContextMenu {
timer.cancel(); timer.cancel();
channel.cancel(NS_ERROR_SAVE_LINK_AS_TIMEOUT); channel.cancel(NS_ERROR_SAVE_LINK_AS_TIMEOUT);
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
}; };

View file

@ -5725,7 +5725,7 @@
!aBrowser.frameLoader || !aBrowser.frameLoader ||
!aBrowser.frameLoader.remoteTab !aBrowser.frameLoader.remoteTab
) { ) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
// Tell our caller to redirect the load into this newly created process. // Tell our caller to redirect the load into this newly created process.

View file

@ -18,7 +18,7 @@ const kPromptServiceFactory = Cm.getClassObject(
var fakePromptServiceFactory = { var fakePromptServiceFactory = {
createInstance(aOuter, aIid) { createInstance(aOuter, aIid) {
if (aOuter != null) { if (aOuter != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return promptService.QueryInterface(aIid); return promptService.QueryInterface(aIid);
}, },

View file

@ -38,7 +38,7 @@ function AboutModule() {}
AboutModule.prototype = { AboutModule.prototype = {
newChannel(aURI, aLoadInfo) { newChannel(aURI, aLoadInfo) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
getURIFlags(aURI) { getURIFlags(aURI) {
@ -62,13 +62,13 @@ AboutModule.prototype = {
var AboutModuleFactory = { var AboutModuleFactory = {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return new AboutModule().QueryInterface(aIID); return new AboutModule().QueryInterface(aIID);
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),

View file

@ -419,7 +419,7 @@ nsBrowserContentHandler.prototype = {
// scripts or applications handle the situation as if Firefox was not // scripts or applications handle the situation as if Firefox was not
// already running. // already running.
if (cmdLine.handleFlag("remote", true)) { if (cmdLine.handleFlag("remote", true)) {
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
} }
var uriparam; var uriparam;
@ -878,7 +878,7 @@ nsBrowserContentHandler.prototype = {
cmdLine.length != urlFlagIdx + 2 || cmdLine.length != urlFlagIdx + 2 ||
/firefoxurl(-[a-f0-9]+)?:/i.test(urlParam) /firefoxurl(-[a-f0-9]+)?:/i.test(urlParam)
) { ) {
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
} }
var isDefault = false; var isDefault = false;
try { try {
@ -892,7 +892,7 @@ nsBrowserContentHandler.prototype = {
if (isDefault) { if (isDefault) {
// Firefox is already the default HTTP handler. // Firefox is already the default HTTP handler.
// We don't have to show the instruction page. // We don't have to show the instruction page.
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
} }
} }
}, },

View file

@ -1078,7 +1078,7 @@ const DownloadsViewPrototype = {
* @note Subclasses should override this. * @note Subclasses should override this.
*/ */
onDownloadStateChanged(download) { onDownloadStateChanged(download) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**
@ -1110,7 +1110,7 @@ const DownloadsViewPrototype = {
* @note Subclasses should override this. * @note Subclasses should override this.
*/ */
onDownloadRemoved(download) { onDownloadRemoved(download) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**
@ -1120,7 +1120,7 @@ const DownloadsViewPrototype = {
* @note Subclasses should override this. * @note Subclasses should override this.
*/ */
_refreshProperties() { _refreshProperties() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**
@ -1129,7 +1129,7 @@ const DownloadsViewPrototype = {
* @note Subclasses should override this. * @note Subclasses should override this.
*/ */
_updateView() { _updateView() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**

View file

@ -755,7 +755,7 @@ PlacesController.prototype = {
async newItem(aType) { async newItem(aType) {
let ip = this._view.insertionPoint; let ip = this._view.insertionPoint;
if (!ip) { if (!ip) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
let bookmarkGuid = PlacesUIUtils.showBookmarkDialog( let bookmarkGuid = PlacesUIUtils.showBookmarkDialog(
@ -778,7 +778,7 @@ PlacesController.prototype = {
async newSeparator() { async newSeparator() {
var ip = this._view.insertionPoint; var ip = this._view.insertionPoint;
if (!ip) { if (!ip) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
let index = await ip.getIndex(); let index = await ip.getIndex();
@ -1266,7 +1266,7 @@ PlacesController.prototype = {
// No reason to proceed if there isn't a valid insertion point. // No reason to proceed if there isn't a valid insertion point.
let ip = this._view.insertionPoint; let ip = this._view.insertionPoint;
if (!ip) { if (!ip) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
let action = this.clipboardAction; let action = this.clipboardAction;

View file

@ -767,7 +767,7 @@ PlacesTreeView.prototype = {
// XXX bug 517701: We don't know what to do when the root node is removed. // XXX bug 517701: We don't know what to do when the root node is removed.
if (aNode == this._rootNode) { if (aNode == this._rootNode) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
} }
// Bail out for hidden separators. // Bail out for hidden separators.
@ -781,7 +781,7 @@ PlacesTreeView.prototype = {
: this._getRowForNode(aParentNode, true); : this._getRowForNode(aParentNode, true);
let oldRow = this._getRowForNode(aNode, true, parentRow, aOldIndex); let oldRow = this._getRowForNode(aNode, true, parentRow, aOldIndex);
if (oldRow < 0) { if (oldRow < 0) {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
// If the node was exclusively selected, the node next to it will be // If the node was exclusively selected, the node next to it will be
@ -847,7 +847,7 @@ PlacesTreeView.prototype = {
: this._getRowForNode(aOldParent, true); : this._getRowForNode(aOldParent, true);
let oldRow = this._getRowForNode(aNode, true, oldParentRow, aOldIndex); let oldRow = this._getRowForNode(aNode, true, oldParentRow, aOldIndex);
if (oldRow < 0) { if (oldRow < 0) {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
// If this node is a container it could take up more than one row. // If this node is a container it could take up more than one row.
@ -1225,7 +1225,7 @@ PlacesTreeView.prototype = {
*/ */
nodeForTreeIndex(aIndex) { nodeForTreeIndex(aIndex) {
if (aIndex > this._rows.length) { if (aIndex > this._rows.length) {
throw Cr.NS_ERROR_INVALID_ARG; throw Components.Exception("", Cr.NS_ERROR_INVALID_ARG);
} }
return this._getNodeForRow(aIndex); return this._getNodeForRow(aIndex);
@ -1394,7 +1394,7 @@ PlacesTreeView.prototype = {
canDrop: function PTV_canDrop(aRow, aOrientation, aDataTransfer) { canDrop: function PTV_canDrop(aRow, aOrientation, aDataTransfer) {
if (!this._result) { if (!this._result) {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
if (this._controller.disableUserActions) { if (this._controller.disableUserActions) {
@ -1634,7 +1634,7 @@ PlacesTreeView.prototype = {
toggleOpenState: function PTV_toggleOpenState(aRow) { toggleOpenState: function PTV_toggleOpenState(aRow) {
if (!this._result) { if (!this._result) {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
let node = this._rows[aRow]; let node = this._rows[aRow];
@ -1661,7 +1661,7 @@ PlacesTreeView.prototype = {
cycleHeader: function PTV_cycleHeader(aColumn) { cycleHeader: function PTV_cycleHeader(aColumn) {
if (!this._result) { if (!this._result) {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
// Sometimes you want a tri-state sorting, and sometimes you don't. This // Sometimes you want a tri-state sorting, and sometimes you don't. This
@ -1764,7 +1764,7 @@ PlacesTreeView.prototype = {
break; break;
default: default:
throw Cr.NS_ERROR_INVALID_ARG; throw Components.Exception("", Cr.NS_ERROR_INVALID_ARG);
} }
this._result.sortingMode = newSort; this._result.sortingMode = newSort;
}, },

View file

@ -3652,7 +3652,7 @@ class InternalHandlerInfoWrapper extends HandlerInfoWrapper {
} }
get enabled() { get enabled() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
} }
get description() { get description() {

View file

@ -20,7 +20,7 @@ const mockUpdateManager = {
createInstance(outer, iiD) { createInstance(outer, iiD) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iiD); return this.QueryInterface(iiD);
}, },

View file

@ -31,7 +31,7 @@ let TestAboutPage = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },

View file

@ -119,7 +119,7 @@ class BrowserDOMWindow {
console.error( console.error(
"createContentWindow should never be called from a remote browser" "createContentWindow should never be called from a remote browser"
); );
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
/** /**
@ -135,7 +135,7 @@ class BrowserDOMWindow {
*/ */
openURI(uri, openWindowInfo, where, flags, triggeringPrincipal, csp) { openURI(uri, openWindowInfo, where, flags, triggeringPrincipal, csp) {
console.error("openURI should never be called from a remote browser"); console.error("openURI should never be called from a remote browser");
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
/** /**

View file

@ -104,7 +104,7 @@ function constructOnePageCmdLine(aURL) {
if (aIndex == 0 && this._argCount) { if (aIndex == 0 && this._argCount) {
return this._arg; return this._arg;
} }
throw Cr.NS_ERROR_INVALID_ARG; throw Components.Exception("", Cr.NS_ERROR_INVALID_ARG);
}, },
findFlag() { findFlag() {
@ -112,11 +112,11 @@ function constructOnePageCmdLine(aURL) {
}, },
removeArguments() { removeArguments() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
handleFlag() { handleFlag() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
handleFlagWithParam() { handleFlagWithParam() {
@ -139,15 +139,15 @@ function constructOnePageCmdLine(aURL) {
preventDefault: false, preventDefault: false,
get workingDirectory() { get workingDirectory() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
get windowContext() { get windowContext() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
resolveFile() { resolveFile() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
resolveURI() { resolveURI() {

View file

@ -1001,7 +1001,7 @@ PdfStreamConverter.prototype = {
// nsIStreamConverter::convert // nsIStreamConverter::convert
convert(aFromStream, aFromType, aToType, aCtxt) { convert(aFromStream, aFromType, aToType, aCtxt) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
// nsIStreamConverter::asyncConvertData // nsIStreamConverter::asyncConvertData

View file

@ -28,7 +28,7 @@ function StreamConverterFactory() {
if (Services.cpmm.sharedData.get("pdfjs.enabled")) { if (Services.cpmm.sharedData.get("pdfjs.enabled")) {
return new PdfStreamConverter(); return new PdfStreamConverter();
} }
throw Cr.NS_ERROR_FACTORY_NOT_REGISTERED; throw Components.Exception("", Cr.NS_ERROR_FACTORY_NOT_REGISTERED);
} }
var EXPORTED_SYMBOLS = ["StreamConverterFactory"]; var EXPORTED_SYMBOLS = ["StreamConverterFactory"];

View file

@ -330,7 +330,7 @@ class FaviconLoad {
if (iid.equals(Ci.nsIChannelEventSink)) { if (iid.equals(Ci.nsIChannelEventSink)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -30,7 +30,7 @@ function run_test() {
contractID: XULAPPINFO_CONTRACTID, contractID: XULAPPINFO_CONTRACTID,
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return XULAppInfo.QueryInterface(iid); return XULAppInfo.QueryInterface(iid);
}, },

View file

@ -18,7 +18,7 @@ ProtocolHandler.prototype = {
defaultPort: -1, defaultPort: -1,
allowPort: () => false, allowPort: () => false,
newChannel() { newChannel() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler]), QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler]),
}; };
@ -75,7 +75,7 @@ function run_test() {
contractID: "@mozilla.org/xre/app-info;1", contractID: "@mozilla.org/xre/app-info;1",
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return XULAppInfo.QueryInterface(iid); return XULAppInfo.QueryInterface(iid);
}, },
@ -94,7 +94,7 @@ function run_test() {
"@mozilla.org/network/protocol;1?name=" + testProtocols[i].scheme, "@mozilla.org/network/protocol;1?name=" + testProtocols[i].scheme,
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter != null) { if (aOuter != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
let handler = new ProtocolHandler(this.scheme, this.flags, this.CID); let handler = new ProtocolHandler(this.scheme, this.flags, this.CID);
return handler.QueryInterface(aIID); return handler.QueryInterface(aIID);

View file

@ -106,7 +106,7 @@ JsonViewSniffer.prototype = {
const JsonSnifferFactory = { const JsonSnifferFactory = {
createInstance: function(outer, iid) { createInstance: function(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return new JsonViewSniffer().QueryInterface(iid); return new JsonViewSniffer().QueryInterface(iid);
}, },
@ -120,7 +120,7 @@ const JsonSnifferFactory = {
const JsonViewFactory = { const JsonViewFactory = {
createInstance: function(outer, iid) { createInstance: function(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return JsonViewService.createInstance().QueryInterface(iid); return JsonViewService.createInstance().QueryInterface(iid);
}, },

View file

@ -120,10 +120,10 @@ BrowserElementWebNavigation.prototype = {
// Bug 1233803 - accessing the sessionHistory of remote browsers should be // Bug 1233803 - accessing the sessionHistory of remote browsers should be
// done in content scripts. // done in content scripts.
get sessionHistory() { get sessionHistory() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
set sessionHistory(value) { set sessionHistory(value) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
_sendMessage(message, data) { _sendMessage(message, data) {
@ -142,7 +142,7 @@ BrowserElementWebNavigation.prototype = {
}, },
swapBrowser(browser) { swapBrowser(browser) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
copyStateFrom(otherWebNavigation) { copyStateFrom(otherWebNavigation) {

View file

@ -83,7 +83,7 @@ NetworkResponseListener.prototype = {
if (this._wrappedNotificationCallbacks) { if (this._wrappedNotificationCallbacks) {
return this._wrappedNotificationCallbacks.getInterface(iid); return this._wrappedNotificationCallbacks.getInterface(iid);
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
/** /**

View file

@ -50,7 +50,7 @@ WebProgressListener.prototype = {
aIID.equals(Ci.nsISupportsWeakReference) || aIID.equals(Ci.nsISupportsWeakReference) ||
aIID.equals(Ci.nsISupports)) aIID.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
}, },
onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) { onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {

View file

@ -46,7 +46,7 @@ function test() {
if (iid.equals(Ci.nsIWebProgressListener) || if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=789773
if (iid.equals(Ci.nsISupportsWeakReference) || if (iid.equals(Ci.nsISupportsWeakReference) ||
iid.equals(Ci.nsIWebProgressListener)) iid.equals(Ci.nsIWebProgressListener))
return this; return this;
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1342989
if (iid.equals(Ci.nsIWebProgressListener) || if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -82,7 +82,7 @@ DOMRequestIpcHelper.prototype = {
this._listeners[name].count++; this._listeners[name].count++;
return; return;
} else { } else {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
} }
@ -279,7 +279,7 @@ DOMRequestIpcHelper.prototype = {
Cu.reportError( Cu.reportError(
"DOMRequestHelper trying to create a DOMRequest without a valid window, failing." "DOMRequestHelper trying to create a DOMRequest without a valid window, failing."
); );
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
return Services.DOMRequest.createRequest(this._window); return Services.DOMRequest.createRequest(this._window);
}, },
@ -295,7 +295,7 @@ DOMRequestIpcHelper.prototype = {
Cu.reportError( Cu.reportError(
"DOMRequestHelper trying to create a Promise without a valid window, failing." "DOMRequestHelper trying to create a Promise without a valid window, failing."
); );
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
return new this._window.Promise(aPromiseInit); return new this._window.Promise(aPromiseInit);
}, },

View file

@ -164,7 +164,7 @@ add_task(async function block_pending_request_test() {
if (aIID.equals(Ci.imgIScriptedNotificationObserver)) { if (aIID.equals(Ci.imgIScriptedNotificationObserver)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
}; };

View file

@ -82,13 +82,13 @@ CustomChannel.prototype = {
return false; return false;
}, },
cancel() { cancel() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
suspend() { suspend() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
resume() { resume() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIChannel, Ci.nsIRequest]), QueryInterface: ChromeUtils.generateQI([Ci.nsIChannel, Ci.nsIRequest]),
}; };

View file

@ -41,7 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800386
forwardFailed = true; forwardFailed = true;
} }
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIInterfaceRequestor]) QueryInterface: ChromeUtils.generateQI([Ci.nsIInterfaceRequestor])

View file

@ -127,15 +127,15 @@ BrowserElementPrompt.prototype = {
checkMsg, checkMsg,
checkState checkState
) { ) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
promptPassword(title, text, password, checkMsg, checkState) { promptPassword(title, text, password, checkMsg, checkState) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
select(title, text, aSelectList, aOutSelection) { select(title, text, aSelectList, aOutSelection) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
_buildConfirmExButtonProperties( _buildConfirmExButtonProperties(
@ -237,7 +237,7 @@ BrowserElementAuthPrompt.prototype = {
QueryInterface: ChromeUtils.generateQI([Ci.nsIAuthPrompt2]), QueryInterface: ChromeUtils.generateQI([Ci.nsIAuthPrompt2]),
promptAuth: function promptAuth(channel, level, authInfo) { promptAuth: function promptAuth(channel, level, authInfo) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
asyncPromptAuth: function asyncPromptAuth( asyncPromptAuth: function asyncPromptAuth(
@ -254,13 +254,13 @@ BrowserElementAuthPrompt.prototype = {
authInfo.flags & Ci.nsIAuthInformation.AUTH_PROXY && authInfo.flags & Ci.nsIAuthInformation.AUTH_PROXY &&
authInfo.flags & Ci.nsIAuthInformation.ONLY_PASSWORD authInfo.flags & Ci.nsIAuthInformation.ONLY_PASSWORD
) { ) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
let frame = this._getFrameFromChannel(channel); let frame = this._getFrameFromChannel(channel);
if (!frame) { if (!frame) {
debug("Cannot get frame, asyncPromptAuth fail"); debug("Cannot get frame, asyncPromptAuth fail");
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
let browserElementParent = BrowserElementPromptService.getBrowserElementParentForFrame( let browserElementParent = BrowserElementPromptService.getBrowserElementParentForFrame(
@ -269,7 +269,7 @@ BrowserElementAuthPrompt.prototype = {
if (!browserElementParent) { if (!browserElementParent) {
debug("Failed to load browser element parent."); debug("Failed to load browser element parent.");
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
let consumer = { let consumer = {
@ -671,7 +671,7 @@ var BrowserElementPromptService = {
var newFactory = { var newFactory = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return newInstance.QueryInterface(iid); return newInstance.QueryInterface(iid);
}, },

View file

@ -221,7 +221,7 @@ setupPrototype(GlobalPCList, {
_xpcom_factory: { _xpcom_factory: {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return _globalPCList.QueryInterface(iid); return _globalPCList.QueryInterface(iid);
}, },

View file

@ -39,12 +39,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=874090
aIID.equals(Ci.nsIAlertsService)) { aIID.equals(Ci.nsIAlertsService)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
createInstance: function(aOuter, aIID) { createInstance: function(aOuter, aIID) {
if (aOuter != null) { if (aOuter != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
} }

View file

@ -57,7 +57,7 @@ var testObserver = {
iid.equals(Ci.nsISupportsWeakReference) || iid.equals(Ci.nsISupportsWeakReference) ||
iid.equals(Ci.nsISupports)) iid.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
}; };

View file

@ -60,7 +60,7 @@ var testObserver = {
iid.equals(Ci.nsISupportsWeakReference) || iid.equals(Ci.nsISupportsWeakReference) ||
iid.equals(Ci.nsISupports)) iid.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
}; };

View file

@ -104,7 +104,7 @@ var testObserver = {
iid.equals(Ci.nsISupportsWeakReference) || iid.equals(Ci.nsISupportsWeakReference) ||
iid.equals(Ci.nsISupports)) iid.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
}; };

View file

@ -109,7 +109,7 @@ var testObserver = {
iid.equals(Ci.nsISupportsWeakReference) || iid.equals(Ci.nsISupportsWeakReference) ||
iid.equals(Ci.nsISupports)) iid.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
}; };

View file

@ -39,7 +39,7 @@
if (iid.equals(nsIWebProgressListener) || if (iid.equals(nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}; };
var loadCount = 0; var loadCount = 0;

View file

@ -66,7 +66,7 @@ function do_get_profile_startup() {
if (prop == "ProfDS") { if (prop == "ProfDS") {
return file.clone(); return file.clone();
} }
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
}, },
QueryInterface: ChromeUtils.generateQI(["nsIDirectoryServiceProvider"]), QueryInterface: ChromeUtils.generateQI(["nsIDirectoryServiceProvider"]),
}; };

View file

@ -62,12 +62,12 @@ PresentationTransportBuilder.prototype = {
buildDataChannelTransport(aRole, aWindow, aListener) { buildDataChannelTransport(aRole, aWindow, aListener) {
if (!aRole || !aWindow || !aListener) { if (!aRole || !aWindow || !aListener) {
log("buildDataChannelTransport with illegal parameters"); log("buildDataChannelTransport with illegal parameters");
throw Cr.NS_ERROR_ILLEGAL_VALUE; throw Components.Exception("", Cr.NS_ERROR_ILLEGAL_VALUE);
} }
if (this._window) { if (this._window) {
log("buildDataChannelTransport has started."); log("buildDataChannelTransport has started.");
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
} }
log("buildDataChannelTransport with role " + aRole); log("buildDataChannelTransport with role " + aRole);
@ -122,7 +122,7 @@ PresentationTransportBuilder.prototype = {
}; };
break; break;
default: default:
throw Cr.NS_ERROR_ILLEGAL_VALUE; throw Components.Exception("", Cr.NS_ERROR_ILLEGAL_VALUE);
} }
// TODO bug 1228235 we should have a way to let device providers customize // TODO bug 1228235 we should have a way to let device providers customize
@ -333,7 +333,7 @@ PresentationTransport.prototype = {
// nsIPresentationTransport // nsIPresentationTransport
get selfAddress() { get selfAddress() {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
}, },
get callback() { get callback() {
@ -373,7 +373,7 @@ PresentationTransport.prototype = {
} }
if (!this._callback) { if (!this._callback) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
this._enableDataNotification = true; this._enableDataNotification = true;
@ -402,7 +402,7 @@ PresentationTransport.prototype = {
_doNotifyData(aData) { _doNotifyData(aData) {
if (!this._callback) { if (!this._callback) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
if (aData instanceof this._window.Blob) { if (aData instanceof this._window.Blob) {

View file

@ -53,7 +53,7 @@ PresentationControlService.prototype = {
if (this._isServiceInit()) { if (this._isServiceInit()) {
DEBUG && DEBUG &&
log("PresentationControlService - server socket has been initialized"); // jshint ignore:line log("PresentationControlService - server socket has been initialized"); // jshint ignore:line
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
/** /**
@ -94,7 +94,7 @@ PresentationControlService.prototype = {
_serverSocketInit(aPort, aCert) { _serverSocketInit(aPort, aCert) {
if (!this._serverSocket) { if (!this._serverSocket) {
DEBUG && log("PresentationControlService - create server socket fail."); // jshint ignore:line DEBUG && log("PresentationControlService - create server socket fail."); // jshint ignore:line
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
try { try {
@ -112,7 +112,7 @@ PresentationControlService.prototype = {
// NS_ERROR_SOCKET_ADDRESS_IN_USE // NS_ERROR_SOCKET_ADDRESS_IN_USE
DEBUG && DEBUG &&
log("PresentationControlService - init server socket fail: " + e); // jshint ignore:line log("PresentationControlService - init server socket fail: " + e); // jshint ignore:line
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
this._port = this._serverSocket.port; this._port = this._serverSocket.port;
@ -235,7 +235,7 @@ PresentationControlService.prototype = {
} catch (e) { } catch (e) {
DEBUG && log("PresentationControlService - createTransport throws: " + e); // jshint ignore:line DEBUG && log("PresentationControlService - createTransport throws: " + e); // jshint ignore:line
// Pop the exception to |TCPDevice.establishControlChannel| // Pop the exception to |TCPDevice.establishControlChannel|
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
return socketTransport; return socketTransport;
}, },
@ -947,7 +947,7 @@ TCPControlChannel.prototype = {
reconnect(aPresentationId, aUrl) { reconnect(aPresentationId, aUrl) {
DEBUG && log("TCPControlChannel - reconnect with role: " + this._direction); // jshint ignore:line DEBUG && log("TCPControlChannel - reconnect with role: " + this._direction); // jshint ignore:line
if (this._direction != "sender") { if (this._direction != "sender") {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
this._stateMachine.reconnect(aPresentationId, aUrl); this._stateMachine.reconnect(aPresentationId, aUrl);

View file

@ -85,7 +85,7 @@ const mockedServerSocket = {
QueryInterface: ChromeUtils.generateQI([Ci.nsIServerSocket, Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIServerSocket, Ci.nsIFactory]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -227,7 +227,7 @@ const mockedDevicePrompt = {
]), ]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -260,7 +260,7 @@ const mockedSessionTransport = {
]), ]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -362,7 +362,7 @@ const mockedNetworkManager = {
QueryInterface: ChromeUtils.generateQI([Ci.nsINetworkManager, Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsINetworkManager, Ci.nsIFactory]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -380,7 +380,7 @@ const mockedRequestUIGlue = {
]), ]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },

View file

@ -165,7 +165,7 @@ const mockDevice = {
type: "type", type: "type",
establishControlChannel(url, presentationId) { establishControlChannel(url, presentationId) {
if (triggerControlChannelError) { if (triggerControlChannelError) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
sendAsyncMessage("control-channel-established"); sendAsyncMessage("control-channel-established");
return mockControlChannelOfSender; return mockControlChannelOfSender;
@ -185,7 +185,7 @@ const mockDevicePrompt = {
]), ]),
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -220,7 +220,7 @@ const mockRequestUIGlue = {
}, },
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },

View file

@ -62,7 +62,7 @@ function loadPrivilegedScriptTest() {
const interfaces = [Ci.nsIPresentationChannelDescription]; const interfaces = [Ci.nsIPresentationChannelDescription];
if (!interfaces.some(v => iid.equals(v))) { if (!interfaces.some(v => iid.equals(v))) {
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
return this; return this;
}, },
@ -102,13 +102,13 @@ function loadPrivilegedScriptTest() {
]; ];
if (!interfaces.some(v => iid.equals(v))) { if (!interfaces.some(v => iid.equals(v))) {
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
return this; return this;
}, },
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },

View file

@ -52,7 +52,7 @@ function MockFactory(aClass) {
MockFactory.prototype = { MockFactory.prototype = {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
switch (typeof this._cls) { switch (typeof this._cls) {
case "function": case "function":
@ -64,7 +64,7 @@ MockFactory.prototype = {
} }
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -27,7 +27,7 @@ XPCOMUtils.defineLazyGetter(this, "PushService", function() {
return PushService; return PushService;
} }
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
}); });
// Observer notification topics for push messages and subscription status // Observer notification topics for push messages and subscription status

View file

@ -41,12 +41,12 @@ let mockAlertsService = {
if (aIID.equals(Ci.nsISupports) || aIID.equals(Ci.nsIAlertsService)) { if (aIID.equals(Ci.nsISupports) || aIID.equals(Ci.nsIAlertsService)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter != null) { if (aOuter != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },

View file

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=
if (aIID.equals(Ci.nsIObserver) || if (aIID.equals(Ci.nsIObserver) ||
aIID.equals(Ci.nsISupports)) aIID.equals(Ci.nsISupports))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
}, },
observe: function(subject, topic, data) { observe: function(subject, topic, data) {
obs.removeObserver(observer, "cycle-collector-begin"); obs.removeObserver(observer, "cycle-collector-begin");

View file

@ -12,12 +12,12 @@ var provider = {
]), ]),
createInstance: function eventsink_ci(outer, iid) { createInstance: function eventsink_ci(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },
lockFactory: function eventsink_lockf(lock) { lockFactory: function eventsink_lockf(lock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
startup() {}, startup() {},
watch() {}, watch() {},

View file

@ -12,12 +12,12 @@ var provider = {
]), ]),
createInstance: function eventsink_ci(outer, iid) { createInstance: function eventsink_ci(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },
lockFactory: function eventsink_lockf(lock) { lockFactory: function eventsink_lockf(lock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
startup() {}, startup() {},
watch() {}, watch() {},

View file

@ -20,7 +20,7 @@ function loadFile(aUriSpec) {
enablePrivilege("UniversalXPConnect"); enablePrivilege("UniversalXPConnect");
var serv = Cc[IOSERVICE_CTRID].getService(nsIIOService); var serv = Cc[IOSERVICE_CTRID].getService(nsIIOService);
if (!serv) { if (!serv) {
throw Cr.ERR_FAILURE; throw Components.Exception("", Cr.ERR_FAILURE);
} }
var chan = NetUtil.newChannel({ var chan = NetUtil.newChannel({
uri: aUriSpec, uri: aUriSpec,

View file

@ -13,7 +13,7 @@ var factory = {
throw new Error("There is no history service"); throw new Error("There is no history service");
}, },
lockFactory() { lockFactory() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -28,7 +28,7 @@ var observer = {
if (aIID.equals(Ci.nsISupports) || if (aIID.equals(Ci.nsISupports) ||
aIID.equals(Ci.nsIObserver)) aIID.equals(Ci.nsIObserver))
return this; return this;
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
observe(subject, topic, data) { observe(subject, topic, data) {

View file

@ -35,7 +35,7 @@ function printpreview() {
if (iid.equals(Ci.nsIWebProgressListener) || if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
} }
var prefs = Cc["@mozilla.org/preferences-service;1"] var prefs = Cc["@mozilla.org/preferences-service;1"]

View file

@ -35,7 +35,7 @@ function printpreview() {
if (iid.equals(Ci.nsIWebProgessListener) || if (iid.equals(Ci.nsIWebProgessListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
} }
var prefs = Cc["@mozilla.org/preferences-service;1"] var prefs = Cc["@mozilla.org/preferences-service;1"]

View file

@ -42,7 +42,7 @@ function printpreview(hasMozPrintCallback) {
if (iid.equals(Ci.nsIWebProgressListener) || if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference)) iid.equals(Ci.nsISupportsWeakReference))
return this; return this;
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
} }
var prefs = Cc["@mozilla.org/preferences-service;1"] var prefs = Cc["@mozilla.org/preferences-service;1"]

View file

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1160724
QueryInterface(iid) { QueryInterface(iid) {
if (!iid.equals(Ci.nsISupports) && if (!iid.equals(Ci.nsISupports) &&
!iid.equals(Ci.nsIConsoleListener)) { !iid.equals(Ci.nsIConsoleListener)) {
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
return this; return this;
}, },

View file

@ -1022,7 +1022,7 @@ FilePickerDelegate.prototype = {
aMode === Ci.nsIFilePicker.modeGetFolder || aMode === Ci.nsIFilePicker.modeGetFolder ||
aMode === Ci.nsIFilePicker.modeSave aMode === Ci.nsIFilePicker.modeSave
) { ) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
} }
this._prompt = new PromptDelegate(aParent); this._prompt = new PromptDelegate(aParent);
this._msg = { this._msg = {
@ -1044,7 +1044,7 @@ FilePickerDelegate.prototype = {
}, },
show() { show() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
open(aFilePickerShownCallback) { open(aFilePickerShownCallback) {
@ -1084,7 +1084,7 @@ FilePickerDelegate.prototype = {
get file() { get file() {
if (!this._fileData) { if (!this._fileData) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
const fileData = this._fileData[0]; const fileData = this._fileData[0];
if (!fileData) { if (!fileData) {
@ -1099,7 +1099,7 @@ FilePickerDelegate.prototype = {
*_getEnumerator(aDOMFile) { *_getEnumerator(aDOMFile) {
if (!this._fileData) { if (!this._fileData) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
for (const fileData of this._fileData) { for (const fileData of this._fileData) {
@ -1123,7 +1123,7 @@ FilePickerDelegate.prototype = {
get domFileOrDirectory() { get domFileOrDirectory() {
if (!this._fileData) { if (!this._fileData) {
throw Cr.NS_ERROR_NOT_AVAILABLE; throw Components.Exception("", Cr.NS_ERROR_NOT_AVAILABLE);
} }
return this._fileData[0] ? this._fileData[0].domFile : null; return this._fileData[0] ? this._fileData[0].domFile : null;
}, },

View file

@ -176,12 +176,12 @@ PushSubscription.prototype = {
/** The last time a message was sent to this subscription. */ /** The last time a message was sent to this subscription. */
get lastPush() { get lastPush() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** The total number of messages sent to this subscription. */ /** The total number of messages sent to this subscription. */
get pushCount() { get pushCount() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**
@ -203,7 +203,7 @@ PushSubscription.prototype = {
/** The private key used to decrypt incoming push messages, in JWK format */ /** The private key used to decrypt incoming push messages, in JWK format */
get p256dhPrivateKey() { get p256dhPrivateKey() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
/** /**

View file

@ -403,7 +403,7 @@ function run_test() {
if (aIID.equals(Ci.nsIObserver) || aIID.equals(Ci.nsISupports)) { if (aIID.equals(Ci.nsIObserver) || aIID.equals(Ci.nsISupports)) {
return this; return this;
} }
throw Cr.NS_NOINTERFACE; throw Components.Exception("", Cr.NS_NOINTERFACE);
} }
observe(aSubject, aTopic, aState) { observe(aSubject, aTopic, aState) {

View file

@ -44,7 +44,7 @@ CustomProtocolHandler.prototype = {
/** nsIFactory */ /** nsIFactory */
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(aIID); return this.QueryInterface(aIID);
}, },
@ -78,7 +78,7 @@ CustomChannel.prototype = {
return this._uploadStream; return this._uploadStream;
}, },
set uploadStream(val) { set uploadStream(val) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
setUploadStream(aStream, aContentType, aContentLength) { setUploadStream(aStream, aContentType, aContentLength) {
this._uploadStream = aStream; this._uploadStream = aStream;
@ -105,10 +105,10 @@ CustomChannel.prototype = {
return -1; return -1;
}, },
set contentLength(val) { set contentLength(val) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
open() { open() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
asyncOpen(aListener) { asyncOpen(aListener) {
var data = ` var data = `

View file

@ -575,7 +575,7 @@ function CustomPipe(name) {
); );
if (this._readable < count || self._data.length < count) { if (this._readable < count || self._data.length < count) {
throw Cr.NS_BASE_STREAM_WOULD_BLOCK; throw Components.Exception("", Cr.NS_BASE_STREAM_WOULD_BLOCK);
} }
this._readable -= count; this._readable -= count;
return self._data.splice(0, count); return self._data.splice(0, count);
@ -881,7 +881,7 @@ function CustomPipe(name) {
); );
if (this._writable < bytes.length) { if (this._writable < bytes.length) {
throw Cr.NS_BASE_STREAM_WOULD_BLOCK; throw Components.Exception("", Cr.NS_BASE_STREAM_WOULD_BLOCK);
} }
self._data.push.apply(self._data, bytes); self._data.push.apply(self._data, bytes);
@ -907,7 +907,7 @@ function CustomPipe(name) {
throw self._status; throw self._status;
} }
if (this._writable === 0) { if (this._writable === 0) {
throw Cr.NS_BASE_STREAM_WOULD_BLOCK; throw Components.Exception("", Cr.NS_BASE_STREAM_WOULD_BLOCK);
} }
var actualWritten; var actualWritten;

View file

@ -279,7 +279,7 @@ OpenCallback.prototype = {
LOG_C2(self, "Notifying"); LOG_C2(self, "Notifying");
self.goon(entry); self.goon(entry);
}); });
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
}, },
}; };

View file

@ -257,12 +257,12 @@ ChannelEventSink.prototype = {
if (iid.equals(Ci.nsIChannelEventSink)) { if (iid.equals(Ci.nsIChannelEventSink)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) { asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {
if (this._flags & ES_ABORT_REDIRECT) { if (this._flags & ES_ABORT_REDIRECT) {
throw Cr.NS_BINDING_ABORTED; throw Components.Exception("", Cr.NS_BINDING_ABORTED);
} }
callback.onRedirectVerifyCallback(Cr.NS_OK); callback.onRedirectVerifyCallback(Cr.NS_OK);

View file

@ -20,12 +20,12 @@ var unsafeAboutModule = {
var factory = { var factory = {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return unsafeAboutModule.QueryInterface(aIID); return unsafeAboutModule.QueryInterface(aIID);
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -95,7 +95,7 @@ Requestor.prototype = {
return this.prompter; return this.prompter;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
prompter: null, prompter: null,
@ -159,7 +159,7 @@ Test.prototype = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable(request, stream, offset, count) { onDataAvailable(request, stream, offset, count) {

View file

@ -148,7 +148,7 @@ Requestor.prototype = {
getInterface: function requestor_gi(iid) { getInterface: function requestor_gi(iid) {
if (iid.equals(Ci.nsIAuthPrompt)) { if (iid.equals(Ci.nsIAuthPrompt)) {
dump("authprompt1 not implemented\n"); dump("authprompt1 not implemented\n");
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
if (iid.equals(Ci.nsIAuthPrompt2)) { if (iid.equals(Ci.nsIAuthPrompt2)) {
try { try {
@ -161,7 +161,7 @@ Requestor.prototype = {
do_throw(e); do_throw(e);
} }
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
prompt2: null, prompt2: null,
@ -197,7 +197,7 @@ var listener = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {

View file

@ -183,7 +183,7 @@ AuthPrompt2.prototype = {
}, },
asyncPromptAuth: function ap2_async(chan, cb, ctx, lvl, info) { asyncPromptAuth: function ap2_async(chan, cb, ctx, lvl, info) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
}; };
@ -211,7 +211,7 @@ Requestor.prototype = {
return this.prompt2; return this.prompt2;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
prompt1: null, prompt1: null,
@ -231,7 +231,7 @@ RealmTestRequestor.prototype = {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
promptAuth: function realmtest_checkAuth(channel, level, authInfo) { promptAuth: function realmtest_checkAuth(channel, level, authInfo) {
@ -241,7 +241,7 @@ RealmTestRequestor.prototype = {
}, },
asyncPromptAuth: function realmtest_async(chan, cb, ctx, lvl, info) { asyncPromptAuth: function realmtest_async(chan, cb, ctx, lvl, info) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
}; };
@ -265,7 +265,7 @@ var listener = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {

View file

@ -36,7 +36,7 @@ NotificationCallbacks.prototype = {
Assert.equal(newChan.originalURI.spec, this._newURI.spec); Assert.equal(newChan.originalURI.spec, this._newURI.spec);
Assert.equal(newChan.originalURI, newChan.URI); Assert.equal(newChan.originalURI, newChan.URI);
Assert.equal(newChan.URI.spec, this._newURI.spec); Assert.equal(newChan.URI.spec, this._newURI.spec);
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
}; };

View file

@ -15,7 +15,7 @@ XPCOMUtils.defineLazyGetter(this, "systemSettings", function() {
mainThreadOnly: true, mainThreadOnly: true,
PACURI: "http://localhost:" + httpserv.identity.primaryPort + "/redirect", PACURI: "http://localhost:" + httpserv.identity.primaryPort + "/redirect",
getProxyForURI(aURI) { getProxyForURI(aURI) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
}; };
}); });

View file

@ -23,12 +23,12 @@ var sniffer = {
QueryInterface: ChromeUtils.generateQI(["nsIFactory", "nsIContentSniffer"]), QueryInterface: ChromeUtils.generateQI(["nsIFactory", "nsIContentSniffer"]),
createInstance: function sniffer_ci(outer, iid) { createInstance: function sniffer_ci(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },
lockFactory: function sniffer_lockf(lock) { lockFactory: function sniffer_lockf(lock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
getMIMETypeFromContent(request, data, length) { getMIMETypeFromContent(request, data, length) {
@ -69,11 +69,11 @@ var listener = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
}, },
onStopRequest: function test_onStopR(request, status) { onStopRequest: function test_onStopR(request, status) {

View file

@ -42,11 +42,11 @@ var listener = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {
throw Cr.NS_ERROR_UNEXPECTED; throw Components.Exception("", Cr.NS_ERROR_UNEXPECTED);
}, },
onStopRequest: function test_onStopR(request, status) { onStopRequest: function test_onStopR(request, status) {

View file

@ -22,12 +22,12 @@ var eventsink = {
QueryInterface: ChromeUtils.generateQI(["nsIFactory", "nsIChannelEventSink"]), QueryInterface: ChromeUtils.generateQI(["nsIFactory", "nsIChannelEventSink"]),
createInstance: function eventsink_ci(outer, iid) { createInstance: function eventsink_ci(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },
lockFactory: function eventsink_lockf(lock) { lockFactory: function eventsink_lockf(lock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
asyncOnChannelRedirect: function eventsink_onredir( asyncOnChannelRedirect: function eventsink_onredir(
@ -38,14 +38,14 @@ var eventsink = {
) { ) {
// veto // veto
this.called = true; this.called = true;
throw Cr.NS_BINDING_ABORTED; throw Components.Exception("", Cr.NS_BINDING_ABORTED);
}, },
getInterface: function eventsink_gi(iid) { getInterface: function eventsink_gi(iid) {
if (iid.equals(Ci.nsIChannelEventSink)) { if (iid.equals(Ci.nsIChannelEventSink)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
called: false, called: false,
@ -86,7 +86,7 @@ var listener = {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {

View file

@ -59,7 +59,7 @@ class UnxpectedAuthPrompt2 {
} }
asyncPromptAuth() { asyncPromptAuth() {
this.signal.triggered = true; this.signal.triggered = true;
throw Cr.ERROR_UNEXPECTED; throw Components.Exception("", Cr.ERROR_UNEXPECTED);
} }
} }
@ -72,7 +72,7 @@ class AuthRequestor {
if (iid.equals(Ci.nsIAuthPrompt2)) { if (iid.equals(Ci.nsIAuthPrompt2)) {
return this.prompt(); return this.prompt();
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -77,7 +77,7 @@ class UnxpectedAuthPrompt2 {
} }
asyncPromptAuth() { asyncPromptAuth() {
this.signal.triggered = true; this.signal.triggered = true;
throw Cr.ERROR_UNEXPECTED; throw Components.Exception("", Cr.ERROR_UNEXPECTED);
} }
} }
@ -105,7 +105,7 @@ class AuthRequestor {
if (iid.equals(Ci.nsIAuthPrompt2)) { if (iid.equals(Ci.nsIAuthPrompt2)) {
return this.prompt(); return this.prompt();
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
} }

View file

@ -128,7 +128,7 @@ function makeListener(headerIdx, bodyIdx) {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {

View file

@ -44,7 +44,7 @@ var listenerCallback = {
if (iid.equals(Ci.nsIProgressEventSink)) { if (iid.equals(Ci.nsIProgressEventSink)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
onProgress(request, progress, progressMax) { onProgress(request, progress, progressMax) {

View file

@ -42,7 +42,7 @@ var progressCallback = {
) { ) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
onStartRequest(request) { onStartRequest(request) {

View file

@ -30,7 +30,7 @@ TestProtocolHandler.prototype = {
Ci.nsIProtocolHandler.ALLOWS_PROXY | Ci.nsIProtocolHandler.ALLOWS_PROXY |
Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD, Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD,
newChannel(uri, aLoadInfo) { newChannel(uri, aLoadInfo) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
allowPort(port, scheme) { allowPort(port, scheme) {
return true; return true;
@ -98,7 +98,7 @@ TestFilter.prototype = {
applyFilter(uri, pi, cb) { applyFilter(uri, pi, cb) {
if (this._result == THROW) { if (this._result == THROW) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
var pi_tail = pps.newProxyInfo( var pi_tail = pps.newProxyInfo(

View file

@ -41,7 +41,7 @@ TestProtocolHandler.prototype = {
Ci.nsIProtocolHandler.ALLOWS_PROXY | Ci.nsIProtocolHandler.ALLOWS_PROXY |
Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD, Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD,
newChannel(uri, aLoadInfo) { newChannel(uri, aLoadInfo) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
allowPort(port, scheme) { allowPort(port, scheme) {
return true; return true;

View file

@ -136,7 +136,7 @@ var connectHandler = {
) { ) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
}; };

View file

@ -51,7 +51,7 @@ Requestor.prototype = {
return this.prompt2; return this.prompt2;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
prompt2: null, prompt2: null,

View file

@ -120,7 +120,7 @@ Requestor.prototype = {
return this.prompt; return this.prompt;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
prompt: null, prompt: null,
@ -145,7 +145,7 @@ var listener = {
} catch (e) { } catch (e) {
do_throw("Unexpected exception: " + e); do_throw("Unexpected exception: " + e);
} }
throw Cr.NS_ERROR_ABORT; throw Components.Exception("", Cr.NS_ERROR_ABORT);
}, },
onDataAvailable: function test_ODA() { onDataAvailable: function test_ODA() {

View file

@ -215,7 +215,7 @@ class DNSListener {
if (aIID.equals(Ci.nsIDNSListener) || aIID.equals(Ci.nsISupports)) { if (aIID.equals(Ci.nsIDNSListener) || aIID.equals(Ci.nsISupports)) {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
// Implement then so we can await this as a promise. // Implement then so we can await this as a promise.

View file

@ -189,7 +189,7 @@ var PACSystemSettings = {
mainThreadOnly: true, mainThreadOnly: true,
PACURI: null, PACURI: null,
getProxyForURI: function getProxyForURI(aURI) { getProxyForURI: function getProxyForURI(aURI) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
}; };

View file

@ -566,7 +566,7 @@ const MarionetteFactory = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
if (!this.instance_) { if (!this.instance_) {

View file

@ -38,7 +38,7 @@ AboutPage.prototype = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer !== null) { if (outer !== null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },

View file

@ -66,7 +66,7 @@ var makeFakeAppDir = function() {
return appD.clone(); return appD.clone();
} }
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
}, },
QueryInterace(iid) { QueryInterace(iid) {
@ -77,7 +77,7 @@ var makeFakeAppDir = function() {
return this; return this;
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
}; };

View file

@ -124,7 +124,7 @@ var updateAppInfo = function(options) {
let factory = { let factory = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return currentAppInfo.QueryInterface(iid); return currentAppInfo.QueryInterface(iid);

View file

@ -57,7 +57,7 @@ var MockRegistrar = Object.freeze({
let factory = { let factory = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
let wrappedMock; let wrappedMock;
@ -78,7 +78,7 @@ var MockRegistrar = Object.freeze({
return wrappedMock.QueryInterface(iid); return wrappedMock.QueryInterface(iid);
}, },
lockFactory(lock) { lockFactory(lock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -50,7 +50,7 @@ class MockRegistry {
get valueCount() { get valueCount() {
if (!this.values) { if (!this.values) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
return this.values.size; return this.values.size;
}, },
@ -68,7 +68,7 @@ class MockRegistry {
getValueName(index) { getValueName(index) {
if (!this.values || index >= this.values.size) { if (!this.values || index >= this.values.size) {
throw Cr.NS_ERROR_FAILURE; throw Components.Exception("", Cr.NS_ERROR_FAILURE);
} }
let names = Array.from(this.values.keys()); let names = Array.from(this.values.keys());
return names[index]; return names[index];

View file

@ -21,12 +21,12 @@ var newFactory = function(window) {
return { return {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return new MockColorPickerInstance(window).QueryInterface(aIID); return new MockColorPickerInstance(window).QueryInterface(aIID);
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -31,12 +31,12 @@ var newFactory = function(window) {
return { return {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return new MockFilePickerInstance(window).QueryInterface(aIID); return new MockFilePickerInstance(window).QueryInterface(aIID);
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -18,12 +18,12 @@ var newClassID = Cc["@mozilla.org/uuid-generator;1"]
var newFactory = { var newFactory = {
createInstance(aOuter, aIID) { createInstance(aOuter, aIID) {
if (aOuter) { if (aOuter) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return new MockPermissionPromptInstance().QueryInterface(aIID); return new MockPermissionPromptInstance().QueryInterface(aIID);
}, },
lockFactory(aLock) { lockFactory(aLock) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]), QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
}; };

View file

@ -24,7 +24,7 @@ class ControllersChild extends JSWindowActorChild {
if (value.type == "long") { if (value.type == "long") {
params.setLongValue(name, parseInt(value.value)); params.setLongValue(name, parseInt(value.value));
} else { } else {
throw Cr.NS_ERROR_NOT_IMPLEMENTED; throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
} }
} }
this.docShell.doCommandWithParams(data.cmd, params); this.docShell.doCommandWithParams(data.cmd, params);

View file

@ -73,7 +73,7 @@ function mockServicesChromeScript() {
createInstance: function(outer, iid) { createInstance: function(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },

View file

@ -81,7 +81,7 @@ add_task(async function test_webRequest_auth_nonblocking_forwardAuthProvider() {
getInterface: ChromeUtils.generateQI([Ci.nsIAuthPromptProvider, getInterface: ChromeUtils.generateQI([Ci.nsIAuthPromptProvider,
Ci.nsIAuthPrompt2]), Ci.nsIAuthPrompt2]),
promptAuth(channel, level, authInfo) { promptAuth(channel, level, authInfo) {
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
getAuthPrompt(reason, iid) { getAuthPrompt(reason, iid) {
return this; return this;
@ -140,7 +140,7 @@ add_task(async function test_webRequest_auth_nonblocking_forwardAuthPrompt2() {
Ci.nsIAuthPrompt2]), Ci.nsIAuthPrompt2]),
getInterface: ChromeUtils.generateQI([Ci.nsIAuthPrompt2]), getInterface: ChromeUtils.generateQI([Ci.nsIAuthPrompt2]),
promptAuth(request, level, authInfo) { promptAuth(request, level, authInfo) {
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
}, },
asyncPromptAuth(request, callback, context, level, authInfo) { asyncPromptAuth(request, callback, context, level, authInfo) {
// We just cancel here, we're only ensuring that non-webrequest // We just cancel here, we're only ensuring that non-webrequest

View file

@ -17,7 +17,7 @@ var mockNetworkStatusService = {
createInstance(outer, iiD) { createInstance(outer, iiD) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iiD); return this.QueryInterface(iiD);
}, },

View file

@ -41,7 +41,7 @@ const mockAlertsService = {
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer != null) { if (outer != null) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },

View file

@ -317,7 +317,7 @@ var ChannelEventSink = {
// nsIFactory implementation // nsIFactory implementation
createInstance(outer, iid) { createInstance(outer, iid) {
if (outer) { if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION; throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
} }
return this.QueryInterface(iid); return this.QueryInterface(iid);
}, },
@ -341,7 +341,7 @@ class AuthRequestor {
try { try {
return this.notificationCallbacks.getInterface(iid); return this.notificationCallbacks.getInterface(iid);
} catch (e) {} } catch (e) {}
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
_getForwardedInterface(iid) { _getForwardedInterface(iid) {
@ -390,7 +390,7 @@ class AuthRequestor {
return callbacks.getInterface(Ci.nsIAuthPrompt2); return callbacks.getInterface(Ci.nsIAuthPrompt2);
} catch (e) {} } catch (e) {}
} }
throw Cr.NS_ERROR_NO_INTERFACE; throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
} }
// nsIAuthPrompt2 asyncPromptAuth // nsIAuthPrompt2 asyncPromptAuth

Some files were not shown because too many files have changed in this diff Show more