@@ -5,34 +5,34 @@ require('../../common');
55const spawn = require ( 'child_process' ) . spawn ;
66
77function run ( cmd , strict , cb ) {
8- const args = [ '--disable-warning=ExperimentalWarning' , '--experimental-strip-types' ] ;
9- if ( strict ) args . push ( '--use_strict' ) ;
10- args . push ( '-p' ) ;
11- const child = spawn ( process . execPath , args ) ;
12- child . stdout . pipe ( process . stdout ) ;
13- child . stderr . pipe ( process . stdout ) ;
14- child . stdin . end ( cmd ) ;
15- child . on ( 'close' , cb ) ;
8+ const args = [ '--disable-warning=ExperimentalWarning' , '--experimental-strip-types' ] ;
9+ if ( strict ) args . push ( '--use_strict' ) ;
10+ args . push ( '-p' ) ;
11+ const child = spawn ( process . execPath , args ) ;
12+ child . stdout . pipe ( process . stdout ) ;
13+ child . stderr . pipe ( process . stdout ) ;
14+ child . stdin . end ( cmd ) ;
15+ child . on ( 'close' , cb ) ;
1616}
1717
1818const queue =
1919 [
20- 'enum Foo{};' ,
21- 'throw new SyntaxError("hello")' ,
22- 'const foo;' ,
23- 'let x: number = 100;x;' ,
24- 'const foo: string = 10;' ,
25- 'function foo(){};foo<Number>(1);' ,
26- 'interface Foo{};const foo;' ,
27- 'function foo(){ await Promise.resolve(1)};' ,
20+ 'enum Foo{};' ,
21+ 'throw new SyntaxError("hello")' ,
22+ 'const foo;' ,
23+ 'let x: number = 100;x;' ,
24+ 'const foo: string = 10;' ,
25+ 'function foo(){};foo<Number>(1);' ,
26+ 'interface Foo{};const foo;' ,
27+ 'function foo(){ await Promise.resolve(1)};' ,
2828 ] ;
2929
3030function go ( ) {
31- const c = queue . shift ( ) ;
32- if ( ! c ) return console . log ( 'done' ) ;
33- run ( c , false , function ( ) {
34- run ( c , true , go ) ;
35- } ) ;
31+ const c = queue . shift ( ) ;
32+ if ( ! c ) return console . log ( 'done' ) ;
33+ run ( c , false , function ( ) {
34+ run ( c , true , go ) ;
35+ } ) ;
3636}
3737
3838go ( ) ;
0 commit comments