mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1217422 - Remove for-each from parser/. r=jst
This commit is contained in:
parent
9081f56f3e
commit
1b1c51c551
@ -36,7 +36,7 @@ function parseTestcase(testcase) {
|
|||||||
var lines = testcase.split("\n");
|
var lines = testcase.split("\n");
|
||||||
|
|
||||||
/* check that the first non-empty, non-comment line is #data */
|
/* check that the first non-empty, non-comment line is #data */
|
||||||
for each (var line in lines) {
|
for (var line of lines) {
|
||||||
if (!line || startsWith(line, "##")) {
|
if (!line || startsWith(line, "##")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ function parseTestcase(testcase) {
|
|||||||
var errors = [];
|
var errors = [];
|
||||||
var fragment = [];
|
var fragment = [];
|
||||||
var currentList = input;
|
var currentList = input;
|
||||||
for each (var line in lines) {
|
for (var line of lines) {
|
||||||
if (startsWith(line, "##todo")) {
|
if (startsWith(line, "##todo")) {
|
||||||
todo(false, line.substring(6));
|
todo(false, line.substring(6));
|
||||||
continue;
|
continue;
|
||||||
@ -84,10 +84,10 @@ function parseTestcase(testcase) {
|
|||||||
* @param The list of strings
|
* @param The list of strings
|
||||||
*/
|
*/
|
||||||
function test_parser(testlist) {
|
function test_parser(testlist) {
|
||||||
for each (var testgroup in testlist) {
|
for (var testgroup of testlist) {
|
||||||
var tests = testgroup.split("#data\n");
|
var tests = testgroup.split("#data\n");
|
||||||
tests = ["#data\n" + test for each(test in tests) if (test)];
|
tests = tests.filter(test => test).map(test => "#data\n" + test);
|
||||||
for each (var test in tests) {
|
for (var test of tests) {
|
||||||
yield parseTestcase(test);
|
yield parseTestcase(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user