@@ -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 */
8686function 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