Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 27c2238

Browse files
committed
Bug 1217422 - Remove for-each from parser/. r=jst
--HG-- extra : commitid : 6D1CzpMntd8 extra : rebase_source : 845919159b1aae44f00938574b4d7ec1b1461a3c
1 parent 943c6c3 commit 27c2238

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

parser/htmlparser/tests/mochitest/parser_datreader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function parseTestcase(testcase) {
3636
var lines = testcase.split("\n");
3737

3838
/* check that the first non-empty, non-comment line is #data */
39-
for each (var line in lines) {
39+
for (var line of lines) {
4040
if (!line || startsWith(line, "##")) {
4141
continue;
4242
}
@@ -51,7 +51,7 @@ function parseTestcase(testcase) {
5151
var errors = [];
5252
var fragment = [];
5353
var currentList = input;
54-
for each (var line in lines) {
54+
for (var line of lines) {
5555
if (startsWith(line, "##todo")) {
5656
todo(false, line.substring(6));
5757
continue;
@@ -84,10 +84,10 @@ function parseTestcase(testcase) {
8484
* @param The list of strings
8585
*/
8686
function test_parser(testlist) {
87-
for each (var testgroup in testlist) {
87+
for (var testgroup of testlist) {
8888
var tests = testgroup.split("#data\n");
89-
tests = ["#data\n" + test for each(test in tests) if (test)];
90-
for each (var test in tests) {
89+
tests = tests.filter(test => test).map(test => "#data\n" + test);
90+
for (var test of tests) {
9191
yield parseTestcase(test);
9292
}
9393
}

0 commit comments

Comments
 (0)