Bug 1129326 - Remove nonstandard let blocks from memory/replace/dmd/test/test_dmd.js. r=njn
This commit is contained in:
@@ -37,22 +37,22 @@ let gDmdTestFile = getExecutable("SmokeDMD" + (gIsWindows ? ".exe" : ""));
|
|||||||
let gDmdScriptFile = getExecutable("dmd.py");
|
let gDmdScriptFile = getExecutable("dmd.py");
|
||||||
|
|
||||||
function readFile(aFile) {
|
function readFile(aFile) {
|
||||||
var fstream = Cc["@mozilla.org/network/file-input-stream;1"]
|
let fstream = Cc["@mozilla.org/network/file-input-stream;1"]
|
||||||
.createInstance(Ci.nsIFileInputStream);
|
.createInstance(Ci.nsIFileInputStream);
|
||||||
var cstream = Cc["@mozilla.org/intl/converter-input-stream;1"]
|
let cstream = Cc["@mozilla.org/intl/converter-input-stream;1"]
|
||||||
.createInstance(Ci.nsIConverterInputStream);
|
.createInstance(Ci.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);
|
||||||
|
|
||||||
var data = "";
|
let data = "";
|
||||||
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);
|
||||||
}
|
|
||||||
cstream.close(); // this closes fstream
|
cstream.close(); // this closes fstream
|
||||||
return data.replace(/\r/g, ""); // normalize line endings
|
return data.replace(/\r/g, ""); // normalize line endings
|
||||||
}
|
}
|
||||||
@@ -195,4 +195,3 @@ function run_test() {
|
|||||||
test("script-diff-dark-matter",
|
test("script-diff-dark-matter",
|
||||||
[jsonFile.path, jsonFile2.path]);
|
[jsonFile.path, jsonFile2.path]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user