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.
This commit is contained in:
Nathan Froyd 2014-12-19 13:48:10 -05:00
parent 447da79bd5
commit b211ce6d68

View File

@ -24,20 +24,19 @@ function SpecialPowers(window) {
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();