Backed out changeset bdec8ddab580 (bug 1418522) for eslint failure at toolkit/content/aboutwebrtc/aboutWebrtc.js:756:37 | Extra space after computed key 'cand.type'. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 20 Nov 2017 20:35:26 +0200
changeset 437279 9131ecd27dd93ac9b3775719b0892fbe2b39705b
parent 437278 3e75d4b94737399ae96e32f90f385c37bc0e32c7
child 437280 da9706e0d3c20adc5c10c492d9950c7d7064407b
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersbackout
bugs1418522
milestone59.0a1
backs outbdec8ddab5804081f7795e575d0c2f4e26c8542d
Backed out changeset bdec8ddab580 (bug 1418522) for eslint failure at toolkit/content/aboutwebrtc/aboutWebrtc.js:756:37 | Extra space after computed key 'cand.type'. r=backout on a CLOSED TREE
toolkit/content/aboutwebrtc/aboutWebrtc.js
--- a/toolkit/content/aboutwebrtc/aboutWebrtc.js
+++ b/toolkit/content/aboutwebrtc/aboutWebrtc.js
@@ -660,18 +660,18 @@ function ICEStats(report) {
   this._report = report;
 }
 
 ICEStats.prototype = {
   render() {
     let tbody = [];
     for (let stat of this.generateICEStats()) {
       tbody.push([
-        stat["local-candidate"] || "",
-        stat["remote-candidate"] || "",
+        stat.localcandidate || "",
+        stat.remotecandidate || "",
         stat.state || "",
         stat.priority || "",
         stat.nominated || "",
         stat.selected || "",
         stat.bytesSent || "",
         stat.bytesReceived || ""
       ]);
     }
@@ -728,38 +728,42 @@ ICEStats.prototype = {
     let stat;
 
     for (let pair of this._report.iceCandidatePairStats) {
       let local = candidates.get(pair.localCandidateId);
       let remote = candidates.get(pair.remoteCandidateId);
 
       if (local) {
         stat = {
-          ["local-candidate"]: this.candidateToString(local),
+          localcandidate: this.candidateToString(local),
           state: pair.state,
           priority: pair.priority,
           nominated: pair.nominated,
           selected: pair.selected,
           bytesSent: pair.bytesSent,
           bytesReceived: pair.bytesReceived
         };
         matched[local.id] = true;
 
         if (remote) {
-          stat["remote-candidate"] = this.candidateToString(remote);
+          stat.remotecandidate = this.candidateToString(remote);
           matched[remote.id] = true;
         }
         stats.push(stat);
       }
     }
 
-    // add the unmatched candidates to the end of the table
-    [...candidates.values()].filter(cand => !matched[cand.id]).forEach(
-      cand => stats.push({[cand.type] : this.candidateToString(cand)})
-    );
+    for (let c of candidates.values()) {
+      if (matched[c.id])
+        continue;
+
+      stat = {};
+      stat[c.type] = this.candidateToString(c);
+      stats.push(stat);
+    }
 
     return stats.sort((a, b) => (b.priority || 0) - (a.priority || 0));
   },
 
   candidateToString(c) {
     if (!c) {
       return "*";
     }