Bug 1133279 - Remove nonstandard let blocks from toolkit/mozapps/extensions. r=Mossop

This commit is contained in:
Chris Peterson 2015-02-05 22:54:56 -08:00
parent 8db771ea29
commit 645f8904ac
2 changed files with 20 additions and 23 deletions

View File

@ -30,14 +30,13 @@ function handleRequest(req, resp) {
createInstance(Components.interfaces.nsITimer); createInstance(Components.interfaces.nsITimer);
timer.init(function sendFile() { timer.init(function sendFile() {
dump("cancelCompatCheck: starting to send file\n"); dump("cancelCompatCheck: starting to send file\n");
let (str = {}) { let str = {};
let read = 0; let read = 0;
do { do {
// read as much as we can and put it in str.value // read as much as we can and put it in str.value
read = cstream.readString(0xffffffff, str); read = cstream.readString(0xffffffff, str);
resp.write(str.value); resp.write(str.value);
} while (read != 0); } while (read != 0);
}
cstream.close(); cstream.close();
resp.finish(); resp.finish();
}, delay, Components.interfaces.nsITimer.TYPE_ONE_SHOT); }, delay, Components.interfaces.nsITimer.TYPE_ONE_SHOT);

View File

@ -1575,14 +1575,13 @@ function interpolateAndServeFile(request, response) {
fstream.init(file, -1, 0, 0); fstream.init(file, -1, 0, 0);
cstream.init(fstream, "UTF-8", 0, 0); cstream.init(fstream, "UTF-8", 0, 0);
let (str = {}) { let str = {};
let read = 0; let read = 0;
do { do {
// read as much as we can and put it in str.value // read as much as we can and put it in str.value
read = cstream.readString(0xffffffff, str); read = cstream.readString(0xffffffff, str);
data += str.value; data += str.value;
} while (read != 0); } while (read != 0);
}
data = data.replace(/%PORT%/g, gPort); data = data.replace(/%PORT%/g, gPort);
response.write(data); response.write(data);
@ -1654,13 +1653,12 @@ function loadFile(aFile) {
createInstance(Components.interfaces.nsIConverterInputStream); createInstance(Components.interfaces.nsIConverterInputStream);
fstream.init(aFile, -1, 0, 0); fstream.init(aFile, -1, 0, 0);
cstream.init(fstream, "UTF-8", 0, 0); cstream.init(fstream, "UTF-8", 0, 0);
let (str = {}) { let str = {};
let read = 0; let read = 0;
do { do {
read = cstream.readString(0xffffffff, str); // read as much as we can and put it in str.value read = cstream.readString(0xffffffff, str); // read as much as we can and put it in str.value
data += str.value; data += str.value;
} while (read != 0); } while (read != 0);
}
cstream.close(); cstream.close();
return data; return data;
} }