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
Родитель d3178b735c
Коммит ef6069c6a3
1 изменённых файлов: 12 добавлений и 13 удалений

Просмотреть файл

@ -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();