mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 1105393 - Remove deprecated for-each-in loops in mochitest/server.js. r=jmaher
This commit is contained in:
parent
7d14ddd10c
commit
0675de044a
@ -74,7 +74,7 @@ function makeTagFunc(tagName)
|
||||
|
||||
function makeTags() {
|
||||
// map our global HTML generation functions
|
||||
for each (var tag in tags) {
|
||||
for (let tag of tags) {
|
||||
this[tag] = makeTagFunc(tag.toLowerCase());
|
||||
}
|
||||
}
|
||||
@ -392,11 +392,15 @@ function list(requestPath, directory, recurse)
|
||||
|
||||
var dir = directory.QueryInterface(Ci.nsIFile);
|
||||
var links = {};
|
||||
|
||||
|
||||
// The SimpleTest directory is hidden
|
||||
var files = [file for (file in dirIter(dir))
|
||||
if (file.exists() && file.path.indexOf("SimpleTest") == -1)];
|
||||
|
||||
let files = [];
|
||||
for (let file of dirIter(dir)) {
|
||||
if (file.exists() && file.path.indexOf("SimpleTest") == -1) {
|
||||
files.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort files by name, so that tests can be run in a pre-defined order inside
|
||||
// a given directory (see bug 384823)
|
||||
function leafNameComparator(first, second) {
|
||||
@ -407,9 +411,9 @@ function list(requestPath, directory, recurse)
|
||||
return 0;
|
||||
}
|
||||
files.sort(leafNameComparator);
|
||||
|
||||
|
||||
count = files.length;
|
||||
for each (var file in files) {
|
||||
for (let file of files) {
|
||||
var key = path + file.leafName;
|
||||
var childCount = 0;
|
||||
if (file.isDirectory()) {
|
||||
@ -548,7 +552,8 @@ function jsonArrayOfTestFiles(links)
|
||||
{
|
||||
var testFiles = [];
|
||||
arrayOfTestFiles(links, testFiles);
|
||||
testFiles = ['"' + file['url'] + '"' for each(file in testFiles)];
|
||||
testFiles = testFiles.map(function(file) { return '"' + file['url'] + '"'; });
|
||||
|
||||
return "[" + testFiles.join(",\n") + "]";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user