Bug 1376357 - Drop use of non-standard catch-if in dom/media/*.js. r?bwc
MozReview-Commit-ID: 1LkJGQz1y1w
--- a/dom/media/IdpSandbox.jsm
+++ b/dom/media/IdpSandbox.jsm
@@ -163,19 +163,22 @@ IdpSandbox.createIdpUri = function(domai
if (uri.hostPort !== domain) {
throw new Error(message + 'domain is invalid');
}
if (uri.path.indexOf('/.well-known/idp-proxy/') !== 0) {
throw new Error(message + 'must produce a /.well-known/idp-proxy/ URI');
}
return uri;
- } catch (e if (typeof e.result !== 'undefined' &&
- e.result === Cr.NS_ERROR_MALFORMED_URI)) {
- throw new Error(message + 'must produce a valid URI');
+ } catch (e) {
+ if (typeof e.result !== 'undefined' &&
+ e.result === Cr.NS_ERROR_MALFORMED_URI) {
+ throw new Error(message + 'must produce a valid URI');
+ }
+ throw e;
}
};
IdpSandbox.prototype = {
isSame: function(domain, protocol) {
return this.source.spec === IdpSandbox.createIdpUri(domain, protocol).spec;
},
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -617,19 +617,22 @@ class RTCPeerConnection {
}
});
let ios = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService);
let nicerNewURI = uriStr => {
try {
return ios.newURI(uriStr);
- } catch (e if (e.result == Cr.NS_ERROR_MALFORMED_URI)) {
- throw new this._win.DOMException(msg + " - malformed URI: " + uriStr,
- "SyntaxError");
+ } catch (e) {
+ if (e.result == Cr.NS_ERROR_MALFORMED_URI) {
+ throw new this._win.DOMException(msg + " - malformed URI: " + uriStr,
+ "SyntaxError");
+ }
+ throw e;
}
};
var stunServers = 0;
iceServers.forEach(({ urls, username, credential, credentialType }) => {
if (!urls) {
throw new this._win.DOMException(msg + " - missing urls", "InvalidAccessError");