@@ -25,7 +25,7 @@ void main(List<String> args) async {
25
25
}
26
26
27
27
// Parse flags.
28
- var parser = new ArgParser ()
28
+ var parser = ArgParser ()
29
29
..addFlag ('help' , abbr: 'h' , help: 'Display this message.' )
30
30
..addFlag ('kernel' ,
31
31
abbr: 'k' , help: 'Compile with the new kernel-based front end.' )
@@ -59,7 +59,7 @@ void main(List<String> args) async {
59
59
defaultsTo: 'all' );
60
60
61
61
var options = parser.parse (args);
62
- if (options['help' ]) {
62
+ if (options['help' ] as bool ) {
63
63
printUsage ();
64
64
print ('Available options:' );
65
65
print (parser.usage);
@@ -134,7 +134,7 @@ void main(List<String> args) async {
134
134
bool chrome = false ;
135
135
bool node = false ;
136
136
bool d8 = false ;
137
- switch (options['runtime' ]) {
137
+ switch (options['runtime' ] as String ) {
138
138
case 'node' :
139
139
node = true ;
140
140
mod = 'common' ;
@@ -219,7 +219,7 @@ void main(List<String> args) async {
219
219
</script>
220
220
''' ;
221
221
var htmlFile = p.setExtension (entry, '.html' );
222
- new File (htmlFile).writeAsStringSync (html);
222
+ File (htmlFile).writeAsStringSync (html);
223
223
var tmp = p.join (Directory .systemTemp.path, 'ddc' );
224
224
225
225
result = Process .runSync (chromeBinary, [
@@ -251,7 +251,7 @@ try {
251
251
}
252
252
''' ;
253
253
var nodeFile = p.setExtension (entry, '.run.js' );
254
- new File (nodeFile).writeAsStringSync (runjs);
254
+ File (nodeFile).writeAsStringSync (runjs);
255
255
var nodeBinary = binary ?? 'node' ;
256
256
result = Process .runSync (
257
257
nodeBinary, ['--inspect=localhost:$port ' , nodeFile],
@@ -278,7 +278,7 @@ try {
278
278
}
279
279
''' ;
280
280
var d8File = p.setExtension (entry, '.d8.js' );
281
- new File (d8File).writeAsStringSync (runjs);
281
+ File (d8File).writeAsStringSync (runjs);
282
282
var d8Binary = binary ?? p.join (dartCheckoutPath, _d8executable);
283
283
result = Process .runSync (d8Binary, ['--module' , d8File]);
284
284
}
@@ -294,5 +294,5 @@ String get _d8executable {
294
294
} else if (Platform .isMacOS) {
295
295
return p.join ('third_party' , 'd8' , 'macos' , 'd8' );
296
296
}
297
- throw new UnsupportedError ('Unsupported platform.' );
297
+ throw UnsupportedError ('Unsupported platform.' );
298
298
}
0 commit comments