[ddc] Migrate sourcemap and stacktrace tests
- Migrate suites and test files to null safety.
- Fix previous migration of sourcemap_testing to ensure list of
expected stops could include null values.
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: Idd3b0937942cef18ae66d35137230437e1e971a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249063
Reviewed-by: Mark Zhou <markzipan@google.com>
diff --git a/pkg/dev_compiler/test/sourcemap/common.dart b/pkg/dev_compiler/test/sourcemap/common.dart
index a443eec..d574968 100644
--- a/pkg/dev_compiler/test/sourcemap/common.dart
+++ b/pkg/dev_compiler/test/sourcemap/common.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'dart:io';
import 'package:_fe_analyzer_shared/src/testing/annotated_code_helper.dart';
@@ -13,10 +11,12 @@
class Data {
Uri uri;
- Directory outDir;
- String testFileName;
- AnnotatedCode code;
- List<String> d8Output;
+ late Directory outDir;
+ late String testFileName;
+ late AnnotatedCode code;
+ late List<String> d8Output;
+
+ Data(this.uri);
}
abstract class ChainContextWithCleanupHelper extends ChainContext {
@@ -26,12 +26,12 @@
Future<void> cleanUp(TestDescription description, Result result) {
if (debugging() && result.outcome != Expectation.Pass) {
print('Not cleaning up: Running in debug-mode for non-passing test.');
- return null;
+ return Future.value();
}
var data = cleanupHelper.remove(description);
- data?.outDir?.deleteSync(recursive: true);
- return null;
+ data?.outDir.deleteSync(recursive: true);
+ return Future.value();
}
bool debugging() => false;
@@ -45,7 +45,7 @@
@override
Future<Result<Data>> run(TestDescription input, ChainContext context) async {
- var data = Data()..uri = input.uri;
+ var data = Data(input.uri);
if (context is ChainContextWithCleanupHelper) {
context.cleanupHelper[input] = data;
}
@@ -99,7 +99,7 @@
}
File findInOutDir(String relative) {
- var outerDir = sdkRoot.path;
+ var outerDir = sdkRoot!.path;
for (var outDir in const [
'out/ReleaseX64',
'xcodebuild/ReleaseX64',
diff --git a/pkg/dev_compiler/test/sourcemap/ddc_common.dart b/pkg/dev_compiler/test/sourcemap/ddc_common.dart
index 6653e57..8d27e08 100644
--- a/pkg/dev_compiler/test/sourcemap/ddc_common.dart
+++ b/pkg/dev_compiler/test/sourcemap/ddc_common.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
library dev_compiler.test.sourcemap.ddc_common;
import 'dart:io';
@@ -23,7 +21,7 @@
}
abstract class WithCompilerState {
- fe.InitializedCompilerState compilerState;
+ fe.InitializedCompilerState? compilerState;
}
class Compile extends Step<Data, Data, ChainContext> {
@@ -98,7 +96,7 @@
return input.resolve('wrapper.js');
}
- String _convertName(String name) {
+ String? _convertName(String? name) {
if (name == null) return null;
// Hack for DDC naming scheme.
var result = name;
@@ -112,7 +110,7 @@
}
}
-Directory _cachedDdcDir;
+Directory? _cachedDdcDir;
Directory getDdcDir() {
Directory search() {
var dir = File.fromUri(Platform.script).parent;
@@ -165,7 +163,8 @@
void createHtmlWrapper(File sdkJsFile, Uri outputFile, String jsContent,
String outputFilename, Uri outDir) {
// For debugging via HTML, Chrome and ./pkg/test_runner/bin/http_server.dart.
- var sdkFile = File(p.relative(sdkJsFile.path, from: sdkRoot.path));
+ var sdkRootPath = sdkRoot!.path;
+ var sdkFile = File(p.relative(sdkJsFile.path, from: sdkRootPath));
var jsRootDart = '/root_dart/${sdkFile.uri}';
File.fromUri(outputFile.resolve('$outputFilename.html.js')).writeAsStringSync(
jsContent.replaceFirst("from 'dart_sdk.js'", "from '$jsRootDart'"));
@@ -174,7 +173,7 @@
jsRootDart, '/root_build/$outputFilename.html.js'));
print('You should now be able to run\n\n'
- 'dart ${sdkRoot.path}/pkg/test_runner/bin/http_server.dart -p 39550 '
+ 'dart $sdkRootPath/pkg/test_runner/bin/http_server.dart -p 39550 '
'--network 127.0.0.1 '
'--build-directory=${outDir.toFilePath()}'
'\n\nand go to\n\n'
@@ -230,7 +229,7 @@
if (name.isEmpty) return r'$';
// Escape any invalid characters
- StringBuffer buffer;
+ StringBuffer? buffer;
for (var i = 0; i < name.length; i++) {
var ch = name[i];
var needsEscape = ch == r'$' || _invalidCharInIdentifier.hasMatch(ch);
diff --git a/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart b/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart
index a20cf67..94bf1f8 100644
--- a/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart
+++ b/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'dart:io';
import 'package:dev_compiler/src/compiler/shared_command.dart';
@@ -24,11 +22,11 @@
implements WithCompilerState {
final Map<String, String> environment;
@override
- fe.InitializedCompilerState compilerState;
+ fe.InitializedCompilerState? compilerState;
SourceMapContext(this.environment);
- List<Step> _steps;
+ List<Step>? _steps;
@override
List<Step> get steps {
@@ -61,7 +59,7 @@
var ddcSdkSummary = findInOutDir('ddc_outline.dill');
var packageConfigPath =
- sdkRoot.uri.resolve('.dart_tool/package_config.json').toFilePath();
+ sdkRoot!.uri.resolve('.dart_tool/package_config.json').toFilePath();
var args = <String>[
'--batch',
'--packages=$packageConfigPath',
@@ -77,7 +75,7 @@
var result = await compile(ParsedArguments.from(args),
compilerState: context.compilerState);
context.compilerState =
- result.compilerState as fe.InitializedCompilerState;
+ result.compilerState as fe.InitializedCompilerState?;
succeeded = result.success;
} catch (e, s) {
print('Unhandled exception:');
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart
index e93433a..21a4cc1 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart
@@ -1,4 +1,6 @@
-// @dart = 2.9
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
import 'package:front_end/src/api_unstable/ddc.dart' as fe;
import 'package:testing/testing.dart';
@@ -15,9 +17,9 @@
class StackTraceContext extends ChainContextWithCleanupHelper
implements WithCompilerState {
@override
- fe.InitializedCompilerState compilerState;
+ fe.InitializedCompilerState? compilerState;
- List<Step> _steps;
+ List<Step>? _steps;
@override
List<Step> get steps {
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_instance_field.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_instance_field.dart
index d0ec237..2a36f88 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_instance_field.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_instance_field.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test(Class());
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_interceptor_field.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_interceptor_field.dart
index a7bace6..d43b10b 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_interceptor_field.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/null_interceptor_field.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
class MyType {
int get length => 3; // ensures we build an interceptor for `.length`
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/rethrow.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/rethrow.dart
index 3bff992..908eb8f 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/rethrow.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/rethrow.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_async.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_async.dart
index c2357bd..e1e10f8 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_async.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_async.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_awaited_async.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_awaited_async.dart
index 740a9e4..0458fc9 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_awaited_async.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_awaited_async.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test1();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor.dart
index b610f05..f57db8f 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
// ignore: UNUSED_LOCAL_VARIABLE
var /*ddc.1:main*/ c = /*ddk.1:main*/ Class();
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor_from_async.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor_from_async.dart
index 62f002d..37467ae 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor_from_async.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_constructor_from_async.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
// This call is no longer on the stack when the error is thrown.
/*1:main*/ test();
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_instance_method.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_instance_method.dart
index ecdfe70..84dac4e3 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_instance_method.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_instance_method.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
var c = Class();
c. /*1:main*/ test();
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_main.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_main.dart
index 8548403..c7043fe 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_main.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_main.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ throw '>ExceptionMarker<';
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_static_method.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_static_method.dart
index eaf057b..89a9033 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_static_method.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_static_method.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*ddc.1:main*/ Class. /*ddk.1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method.dart
index 125bc2d..799c9c0 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method_from_async.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method_from_async.dart
index 5dd30d1..06ec99f 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method_from_async.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_top_level_method_from_async.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test1();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_catch.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_catch.dart
index 359b523..9ce488c 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_catch.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_catch.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_finally.dart b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_finally.dart
index b92875b..211f9ed 100644
--- a/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_finally.dart
+++ b/pkg/dev_compiler/test/sourcemap/stacktrace_testfiles/throw_in_try_finally.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*1:main*/ test();
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/breakpoint_on_function_line_breaks_in_body.dart b/pkg/dev_compiler/test/sourcemap/testfiles/breakpoint_on_function_line_breaks_in_body.dart
index 0748c25..b38f0821 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/breakpoint_on_function_line_breaks_in_body.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/breakpoint_on_function_line_breaks_in_body.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
foo();
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/call_on_field_in_class.dart b/pkg/dev_compiler/test/sourcemap/testfiles/call_on_field_in_class.dart
index 51c0dcc..1d40779 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/call_on_field_in_class.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/call_on_field_in_class.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/* bl */ var foo = /*sl:1*/ Foo();
foo.foo = foo. /*sl:2*/ fooMethod;
@@ -14,11 +12,11 @@
// (back in dart.callMethod) -> dart._checkAndCall -> fooMethod
// which seems unlikely to be something the user is going to step through.
// As a "fix" here a breakpoint has been set on the line in fooMethod.
- foo. /*sl:5*/ foo();
+ foo. /*sl:5*/ foo!();
}
class Foo {
- void Function() foo;
+ void Function()? foo;
void fooMethod() {
/*bl*/ /*s:4*/ /*s:6*/ print('Hello from fooMethod');
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/hello_async.dart b/pkg/dev_compiler/test/sourcemap/testfiles/hello_async.dart
index 11023f4..62fba8c 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/hello_async.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/hello_async.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*bl*/
/*s:1*/ foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/hello_call.dart b/pkg/dev_compiler/test/sourcemap/testfiles/hello_call.dart
index 6f93981..1f28925 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/hello_call.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/hello_call.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*bl*/
/*s:1*/ foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/hello_class_call.dart b/pkg/dev_compiler/test/sourcemap/testfiles/hello_class_call.dart
index a1cc9fd..05bdd91 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/hello_class_call.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/hello_class_call.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*bl*/
var foo = Foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/hello_sane_column_on_print_return_value.dart b/pkg/dev_compiler/test/sourcemap/testfiles/hello_sane_column_on_print_return_value.dart
index 54b020d..2f1663c 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/hello_sane_column_on_print_return_value.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/hello_sane_column_on_print_return_value.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*bc:3*/ print(/*bc:1*/ foo());
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/hello_world.dart b/pkg/dev_compiler/test/sourcemap/testfiles/hello_world.dart
index a034e08..e8181f7 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/hello_world.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/hello_world.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/*nb*/ // no break on empty line
/*bl*/ print('Hello, World!');
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters.dart b/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters.dart
index cbf1689..eea7830 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters.dart
@@ -2,14 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
foo(/*bc:1*/ bar(), baz: /*bc:2*/ baz());
/*nbb:0:4*/
}
-void foo(int bar, {int /*bc:3*/ baz}) {
+void foo(int bar, {int? /*bc:3*/ baz}) {
/*bc:4*/ print('foo!');
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters_no_given.dart b/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters_no_given.dart
index a47263d..3122107 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters_no_given.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/method_call_with_named_parameters_no_given.dart
@@ -2,14 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
foo(/*bc:1*/ bar());
/*nbb:0:3*/
}
-void foo(int bar, {int /*bc:2*/ baz}) {
+void foo(int bar, {int? /*bc:2*/ baz}) {
/*bc:3*/ print('foo!');
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/multiple_debugger_calls.dart b/pkg/dev_compiler/test/sourcemap/testfiles/multiple_debugger_calls.dart
index 7ce45b4..8801ae9 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/multiple_debugger_calls.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/multiple_debugger_calls.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'dart:developer';
// Regression test: https://github.com/dart-lang/sdk/issues/45544
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assert.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assert.dart
index 478deef..eab2e71 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assert.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assert.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
assert(/*bc:1*/ foo());
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_call_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_call_test.dart
index 5da999c..951e0a8 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_call_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_call_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
/*nb*/ int a;
@@ -15,7 +13,7 @@
/*bc:5*/ print(a);
var d = /*bc:6*/ foo();
/*bc:7*/ print(d);
- int e = /*bc:8*/ foo(), f, g = /*bc:9*/ foo();
+ int? e = /*bc:8*/ foo(), f, g = /*bc:9*/ foo();
/*bc:10*/ print(e);
/*bc:11*/ print(f);
/*bc:12*/ print(g);
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_int_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_int_test.dart
index d73151f..41cfb65 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_int_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_assign_int_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
/*nb*/ int a;
@@ -16,7 +14,7 @@
/*s:5*/ print(a);
var d = /*s:6*/ 42;
/*s:7*/ print(d);
- int e = /*s:8*/ 41, f, g = /*s:9*/ 42;
+ int? e = /*s:8*/ 41, f, g = /*s:9*/ 42;
/*s:10*/ print(e);
/*s:11*/ print(f);
/*s:12*/ print(g);
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_catch_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_catch_test.dart
index 93b9271..9a6f371 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_catch_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_catch_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
/*bl*/
try {
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_each_loop_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_each_loop_test.dart
index d9a8a77..20c74c1 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_each_loop_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_each_loop_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
/*bl*/ /*sl:1*/ var data = [1, 2, 3];
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_loop_with_break_and_continue_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_loop_with_break_and_continue_test.dart
index 962f8fc..a3e6148 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_loop_with_break_and_continue_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_for_loop_with_break_and_continue_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
/*bl*/ /*sl:1*/ var count = 0;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_is_and_as_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_is_and_as_test.dart
index d984c0d..20daab9 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_is_and_as_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_is_and_as_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
/*bl*/
/*sl:1*/ var i = 42.42;
@@ -19,6 +16,7 @@
/*bc:7*/ if (i is! int) {
/*bc:8*/ print('i is not int');
}
+ // ignore: unnecessary_type_check
/*bc:9*/ if (hex is int) {
/*bc:10*/ print('hex is int');
// ignore: unnecessary_cast
@@ -29,6 +27,7 @@
print("but it's not even even!");
}
}
+ // ignore: unnecessary_type_check
/*bc:14*/ if (hex is! int) {
print('hex is not int');
}
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_map_creation.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_map_creation.dart
index 53eb14d..eac9eda 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_map_creation.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_map_creation.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
/*bl*/
var x = {/*bc:1*/ foo(): /*bc:2*/ bar() };
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_multi_catch_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_multi_catch_test.dart
index 57e1ce9..44bc4dde 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_multi_catch_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_multi_catch_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
/*bl*/
try {
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_super_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_super_test.dart
index bfd9266c..7a2bcca 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_super_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_super_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
class Class2 {
dynamic operator [](index) => index;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_this_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_this_test.dart
index 7fc64b2..2038431 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_this_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_on_this_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
class Class2 {
dynamic operator [](index) => index;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_test.dart
index 9351447..e9076fb 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_operator_bracket_test.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
class Class2 {
dynamic operator [](index) => index;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_static_set.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_static_set.dart
index e63b7ff..0f39f0b 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_static_set.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_static_set.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
var bar = 0;
void main() {
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_concatenation.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_concatenation.dart
index 02d4137..35c4500 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_concatenation.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_concatenation.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
String qux;
qux = '${/*bc:1*/ foo()} x ${/*bc:2*/ bar()} x ${/*bc:3*/ baz()}';
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_plus.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_plus.dart
index f395f55..be9ce11 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_plus.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_string_plus.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
String qux;
qux = /*bc:1*/ foo() + /*bc:2*/ bar();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_throw.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_throw.dart
index bc00462c..fb23828 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_throw.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_throw.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
try {
throw /*bc:1*/ foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_variable_set.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_variable_set.dart
index cce899b..0fad64b 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_variable_set.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_variable_set.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
/*bl*/
/*sl:1*/ var x = 0;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_yield.dart b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_yield.dart
index 62694a2..b3acab0 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/next_through_yield.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/next_through_yield.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
for (var i in naturalsTo(2)) {
print(i);
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_constructor_line.dart b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_constructor_line.dart
index 8a143f8..b5d935b 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_constructor_line.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_constructor_line.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
// ignore: unused_local_variable
var foo = Foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_function_line.dart b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_function_line.dart
index 5c2966b..8b3b281 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_function_line.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_function_line.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
var foo = Foo();
foo.foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_line.dart b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_line.dart
index 92781ce..f7943d6 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_line.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_line.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
var foo = Foo();
foo.foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_named_constructor_line.dart b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_named_constructor_line.dart
index 75e9030..9c71302 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_named_constructor_line.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_class_named_constructor_line.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
// ignore: unused_local_variable
var foo = Foo.named();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_function_line.dart b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_function_line.dart
index eedeb22..4683e61 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_function_line.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/no_mapping_on_function_line.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*nm*/
void main() {
foo();
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields.dart b/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields.dart
index e1cd050..3594711 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
void main() {
/*bl*/
@@ -19,7 +17,7 @@
}
class Foo {
- int x, y, z;
+ int? x, y, z;
Foo(int a, int b)
: x = a,
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields_step_into.dart b/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields_step_into.dart
index ab8d8a3..ea56b04 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields_step_into.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/printing_class_fields_step_into.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*nb*/
void main() {
/*bl*/
@@ -14,7 +12,7 @@
}
class Foo {
- int x, y, z;
+ int? x, y, z;
Foo(int a, int b)
: /*sl:2*/ x = a, // `s:2` fails, DDK is missing hover info
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_async_star_yield.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_async_star_yield.dart
index ad18584..b9fd205 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_async_star_yield.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_async_star_yield.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() async {
await for (var i in foobar() as Stream) {
print(i);
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_await_for.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_await_for.dart
index 1dd6548..20fc828 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_await_for.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_await_for.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() async {
/* bl */
/*sl:1 */ print('About to loop!');
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_conditional_expression.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_conditional_expression.dart
index 45a661d..b8cfb71 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_conditional_expression.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_conditional_expression.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
print(/*bc:1*/ foo() ? bar() : /*bc:2*/ baz());
print(! /*bc:3*/ foo() ? /*bc:4*/ bar() : baz());
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_if_and_identical.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_if_and_identical.dart
index 0e57fda..6af41a9 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_if_and_identical.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_if_and_identical.dart
@@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
/*Debugger:stepOver*/
-
void main() {
if (/*bc:1*/ foo() == /*bc:2*/ bar()) {
print('wat?!?');
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_property_get_test.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_property_get_test.dart
index 2e5bcad..25fdc3e 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_property_get_test.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_property_get_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
var bar = Bar();
bar.doStuff();
@@ -22,7 +20,7 @@
class Bar extends Foo {
final List<String> /*s:2*/ /*s:4*/ data2;
- Foo data3;
+ Foo? data3;
Bar() : data2 = ['d', 'e', 'f'] {
data3 = this;
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_sync_star.dart b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_sync_star.dart
index 2aaec15..4ce057b 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/step_through_sync_star.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/step_through_sync_star.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
/* bl */
/*sl:1*/ var iterator = naturalsTo(2);
diff --git a/pkg/dev_compiler/test/sourcemap/testfiles/stops_at_ending_brace.dart b/pkg/dev_compiler/test/sourcemap/testfiles/stops_at_ending_brace.dart
index 0e1347d..d322e4c 100644
--- a/pkg/dev_compiler/test/sourcemap/testfiles/stops_at_ending_brace.dart
+++ b/pkg/dev_compiler/test/sourcemap/testfiles/stops_at_ending_brace.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
void main() {
Foo();
// Comment to push the ending brace back a bit.
diff --git a/pkg/sourcemap_testing/lib/src/stepping_helper.dart b/pkg/sourcemap_testing/lib/src/stepping_helper.dart
index 9392f77..cd4651e 100644
--- a/pkg/sourcemap_testing/lib/src/stepping_helper.dart
+++ b/pkg/sourcemap_testing/lib/src/stepping_helper.dart
@@ -89,7 +89,7 @@
.map((entry) => '${entry.line}:${entry.column}')
.toSet();
- List<String> expectedStops = [];
+ List<String?> expectedStops = [];
for (Annotation annotation in code.annotations.where((annotation) =>
annotation.text.trim().startsWith('s:') ||
annotation.text.trim().startsWith('sl:') ||
@@ -148,7 +148,7 @@
void _checkRecordedStops(
List<String> recordStops,
- List<String> expectedStops,
+ List<String?> expectedStops,
List<List<String>?> noBreaksStart,
List<List<String>?> noBreaksEnd,
bool debug) {
@@ -166,7 +166,8 @@
for (String recorded in recordStops) {
stopNumber++;
if (expectedIndex == expectedStops.length) break;
- if ('$recorded:'.contains(expectedStops[expectedIndex])) {
+ var expectedStop = expectedStops[expectedIndex];
+ if (expectedStop != null && '$recorded:'.contains(expectedStop)) {
++expectedIndex;
if (noBreaksStart.length > expectedIndex &&
noBreaksStart[expectedIndex] != null) {