Bug 1376357 - Fix remaining ESLint issues in dom/media/*.js*. r?bwc
MozReview-Commit-ID: 7kjmQt1Ik6e
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -99,16 +99,17 @@ class GlobalPCList {
for (let pcref of this._list[winId]) {
let pc = pcref.get();
if (pc && pc._globalPCListId == globalPCListId) {
return pc;
}
}
}
}
+ return null;
}
removeNullRefs(winID) {
if (this._list[winID] === undefined) {
return;
}
this._list[winID] = this._list[winID].filter(
function(e, i, a) { return e.get() !== null; });
@@ -435,18 +436,16 @@ class RTCPeerConnection {
this.makeGetterSetterEH("onidpvalidationerror");
this._pc = new this._win.PeerConnectionImpl();
this._operationsChain = this._win.Promise.resolve();
this.__DOM_IMPL__._innerObject = this;
this._observer = new this._win.PeerConnectionObserver(this.__DOM_IMPL__);
- var location = "" + this._win.location;
-
// Warn just once per PeerConnection about deprecated getStats usage.
this._warnDeprecatedStatsAccessNullable = { warn: () =>
this.logWarning("non-maplike pc.getStats access is deprecated, and will be removed in the near future! " +
"See http://w3c.github.io/webrtc-pc/#getstats-example for usage.") };
this._warnDeprecatedStatsCallbacksNullable = { warn: () =>
this.logWarning("Callback-based pc.getStats is deprecated, and will be removed in the near future! Use promise-version! " +
"See http://w3c.github.io/webrtc-pc/#getstats-example for usage.") };
@@ -522,17 +521,17 @@ class RTCPeerConnection {
let p = (async () => {
await this._operationsChain;
// Don't _checkClosed() inside the chain, because it throws, and spec
// behavior is to NOT reject outstanding promises on close. This is what
// happens most of the time anyways, as the c++ code stops calling us once
// closed, hanging the chain. However, c++ may already have queued tasks
// on us, so if we're one of those then sit back.
if (this._closed) {
- return;
+ return null;
}
return await func();
})();
// don't propagate errors in the operations chain (this is a fork of p).
this._operationsChain = p.catch(() => {});
return await p;
}
@@ -1126,17 +1125,17 @@ class RTCPeerConnection {
return uniqueRids;
}, {});
this._impl.setParameters(track, parameters);
}
_getParameters({ track }) {
if (!Services.prefs.getBoolPref("media.peerconnection.simulcast")) {
- return;
+ return null;
}
return this._impl.getParameters(track);
}
close() {
if (this._closed) {
return;
}
@@ -1286,17 +1285,16 @@ setupPrototype(RTCPeerConnection, {
contractID: PC_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
Ci.nsIDOMGlobalPropertyInitializer]),
_actions: {
offer: Ci.IPeerConnection.kActionOffer,
answer: Ci.IPeerConnection.kActionAnswer,
pranswer: Ci.IPeerConnection.kActionPRAnswer,
rollback: Ci.IPeerConnection.kActionRollback,
- answer: Ci.IPeerConnection.kActionAnswer,
},
});
// This is a separate class because we don't want to expose it to DOM.
class PeerConnectionObserver {
init(win) {
this._win = win;
--- a/dom/media/PeerConnectionIdp.jsm
+++ b/dom/media/PeerConnectionIdp.jsm
@@ -101,17 +101,17 @@ PeerConnectionIdp.prototype = {
// a=identity is session level
let idMatch;
let mLineMatch = sdp.match(PeerConnectionIdp._mLinePattern);
if (mLineMatch) {
let sessionLevel = sdp.substring(0, mLineMatch.index);
idMatch = sessionLevel.match(PeerConnectionIdp._identityPattern);
}
if (!idMatch) {
- return; // undefined === no identity
+ return undefined; // undefined === no identity
}
let assertion;
try {
assertion = JSON.parse(atob(idMatch[1]));
} catch (e) {
throw new this._win.DOMException("invalid identity assertion: " + e,
"InvalidSessionDescriptionError");