Bug 1113750 - fix deprecated let block construct in specialpowers.js; r=jmaher
authorNathan Froyd <froydnj@mozilla.com>
Fri, 19 Dec 2014 13:48:10 -0500
changeset 233273 f2c81560f516c7ca24f6946a7373aec0f1155722
parent 233272 dc45e97d102d2f814b7a8da84ac251ef32991cce
child 233274 3ead6c54b6c5e4f4f8fdb866ba11b23cfe175e65
push id285
push usernalexander@mozilla.com
push dateSun, 21 Dec 2014 23:30:10 +0000
reviewersjmaher
bugs1113750
milestone37.0a1
Bug 1113750 - fix deprecated let block construct in specialpowers.js; r=jmaher This warning occurs scores of times in every browser-chrome test run. There's no need for it to, since we can use supported syntax instead.
testing/specialpowers/content/specialpowers.js
--- a/testing/specialpowers/content/specialpowers.js
+++ b/testing/specialpowers/content/specialpowers.js
@@ -19,30 +19,29 @@ function SpecialPowers(window) {
           var win = this.window.get();
           if (!win)
               return null;
           return getRawComponents(win);
       }});
   this._pongHandlers = [];
   this._messageListener = this._messageReceived.bind(this);
   addMessageListener("SPPingService", this._messageListener);
-  let (self = this) {
-    Services.obs.addObserver(function onInnerWindowDestroyed(subject, topic, data) {
-      var id = subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
-      if (self._windowID === id) {
-        Services.obs.removeObserver(onInnerWindowDestroyed, "inner-window-destroyed");
-        try {
-          removeMessageListener("SPPingService", self._messageListener);
-        } catch (e if e.result == Components.results.NS_ERROR_ILLEGAL_VALUE) {
-          // Ignore the exception which the message manager has been destroyed.
-          ;
-        }
+  let self = this;
+  Services.obs.addObserver(function onInnerWindowDestroyed(subject, topic, data) {
+    var id = subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
+    if (self._windowID === id) {
+      Services.obs.removeObserver(onInnerWindowDestroyed, "inner-window-destroyed");
+      try {
+        removeMessageListener("SPPingService", self._messageListener);
+      } catch (e if e.result == Components.results.NS_ERROR_ILLEGAL_VALUE) {
+        // Ignore the exception which the message manager has been destroyed.
+        ;
       }
-    }, "inner-window-destroyed", false);
-  }
+    }
+  }, "inner-window-destroyed", false);
 }
 
 SpecialPowers.prototype = new SpecialPowersAPI();
 
 SpecialPowers.prototype.toString = function() { return "[SpecialPowers]"; };
 SpecialPowers.prototype.sanityCheck = function() { return "foo"; };
 
 // This gets filled in in the constructor.