Skip to content

Commit 765651b

Browse files
nateboschcommit-bot@chromium.org
authored andcommitted
Fix some diagnostics in ddb tool
Renaming to `ddb.dart` exposes these in the analysis server. Change-Id: I03485debcc2a0d6f8d2feca9418f910ade7cf10a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117590 Reviewed-by: Nicholas Shahan <[email protected]> Commit-Queue: Nate Bosch <[email protected]>
1 parent fc4021b commit 765651b

File tree

1 file changed

+7
-7
lines changed
  • pkg/dev_compiler/tool

1 file changed

+7
-7
lines changed

pkg/dev_compiler/tool/ddb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void main(List<String> args) async {
2525
}
2626

2727
// Parse flags.
28-
var parser = new ArgParser()
28+
var parser = ArgParser()
2929
..addFlag('help', abbr: 'h', help: 'Display this message.')
3030
..addFlag('kernel',
3131
abbr: 'k', help: 'Compile with the new kernel-based front end.')
@@ -59,7 +59,7 @@ void main(List<String> args) async {
5959
defaultsTo: 'all');
6060

6161
var options = parser.parse(args);
62-
if (options['help']) {
62+
if (options['help'] as bool) {
6363
printUsage();
6464
print('Available options:');
6565
print(parser.usage);
@@ -134,7 +134,7 @@ void main(List<String> args) async {
134134
bool chrome = false;
135135
bool node = false;
136136
bool d8 = false;
137-
switch (options['runtime']) {
137+
switch (options['runtime'] as String) {
138138
case 'node':
139139
node = true;
140140
mod = 'common';
@@ -219,7 +219,7 @@ void main(List<String> args) async {
219219
</script>
220220
''';
221221
var htmlFile = p.setExtension(entry, '.html');
222-
new File(htmlFile).writeAsStringSync(html);
222+
File(htmlFile).writeAsStringSync(html);
223223
var tmp = p.join(Directory.systemTemp.path, 'ddc');
224224

225225
result = Process.runSync(chromeBinary, [
@@ -251,7 +251,7 @@ try {
251251
}
252252
''';
253253
var nodeFile = p.setExtension(entry, '.run.js');
254-
new File(nodeFile).writeAsStringSync(runjs);
254+
File(nodeFile).writeAsStringSync(runjs);
255255
var nodeBinary = binary ?? 'node';
256256
result = Process.runSync(
257257
nodeBinary, ['--inspect=localhost:$port', nodeFile],
@@ -278,7 +278,7 @@ try {
278278
}
279279
''';
280280
var d8File = p.setExtension(entry, '.d8.js');
281-
new File(d8File).writeAsStringSync(runjs);
281+
File(d8File).writeAsStringSync(runjs);
282282
var d8Binary = binary ?? p.join(dartCheckoutPath, _d8executable);
283283
result = Process.runSync(d8Binary, ['--module', d8File]);
284284
}
@@ -294,5 +294,5 @@ String get _d8executable {
294294
} else if (Platform.isMacOS) {
295295
return p.join('third_party', 'd8', 'macos', 'd8');
296296
}
297-
throw new UnsupportedError('Unsupported platform.');
297+
throw UnsupportedError('Unsupported platform.');
298298
}

0 commit comments

Comments
 (0)