Skip to content

Commit 2e65ddf

Browse files
author
Anna Gringauze
authored
Prepare for dart 3.0 alpha breaking changes (#1880)
* Prepare for dart 3.0 alpha breaking changes * Use https instead of ssh
1 parent 2e2587a commit 2e65ddf

File tree

11 files changed

+73
-44
lines changed

11 files changed

+73
-44
lines changed

dwds/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
- Pre-warm expression compiler cache to speed up Flutter Inspector loading.
1515
- Remove `ChromeProxyService.setExceptionPauseMode()`.
1616
- Display full error on failure to start DDS.
17-
- Fix crash on processing DevTools event when starting DevTools from observatory
17+
- Fix crash on processing DevTools event when starting DevTools from DevTools
1818
uri.
19+
- Prepare or Dart 3 alpha breaking changes:
20+
- Move weak null safety tests to special branch of `build_web_compilers`.
21+
- Do not pass `--(no)-sound-null-safety` flag to build daemon.
22+
1923

2024
## 16.0.1
2125

dwds/test/evaluate_common.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,23 @@ void testAll({
141141
await setup.service.resume(isolateId);
142142
});
143143

144+
test('uses correct null safety mode', () async {
145+
await onBreakPoint(isolateId, mainScript, 'printLocal', () async {
146+
final event = await stream
147+
.firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
148+
149+
final isNullSafetyEnabled =
150+
'() { const sound = !(<Null>[] is List<int>); return sound; } ()';
151+
final result = await setup.service.evaluateInFrame(
152+
isolateId, event.topFrame!.index!, isNullSafetyEnabled);
153+
154+
expect(
155+
result,
156+
isA<InstanceRef>().having((instance) => instance.valueAsString,
157+
'valueAsString', '${nullSafety == NullSafety.sound}'));
158+
});
159+
});
160+
144161
test('does not crash if class metadata cannot be found', () async {
145162
await onBreakPoint(isolateId, mainScript, 'printStream', () async {
146163
final event = await stream

dwds/test/fixtures/context.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ class TestContext {
261261
String basePath = '';
262262

263263
_port = await findUnusedPort();
264-
final soundNullSafety = nullSafety == NullSafety.sound;
265264
switch (compilationMode) {
266265
case CompilationMode.buildDaemon:
267266
{
@@ -270,8 +269,6 @@ class TestContext {
270269
'--define',
271270
'build_web_compilers|ddc=generate-full-dill=true',
272271
],
273-
'--define',
274-
'build_web_compilers:entrypoint=sound_null_safety=$soundNullSafety',
275272
'--verbose',
276273
];
277274
_daemonClient =

fixtures/_test/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ dependencies:
1717

1818
dev_dependencies:
1919
build_runner: '>=1.6.2 <3.0.0'
20-
build_web_compilers: '>=2.12.0 <4.0.0'
20+
build_web_compilers:
21+
git:
22+
url: https://github.com/dart-lang/build.git
23+
ref: legacy_force_opt_out
24+
path: build_web_compilers

fixtures/_testCircular1/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ dependencies:
1919

2020
dev_dependencies:
2121
build_runner: ^2.0.0
22-
build_web_compilers: ^3.0.0
22+
build_web_compilers:
23+
git:
24+
url: https://github.com/dart-lang/build.git
25+
ref: legacy_force_opt_out
26+
path: build_web_compilers

fixtures/_testCircular2/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ dependencies:
1717

1818
dev_dependencies:
1919
build_runner: ^2.0.0
20-
build_web_compilers: ^3.0.0
20+
build_web_compilers:
21+
git:
22+
url: https://github.com/dart-lang/build.git
23+
ref: legacy_force_opt_out
24+
path: build_web_compilers

fixtures/_testPackage/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ dependencies:
1717

1818
dev_dependencies:
1919
build_runner: ^2.0.0
20-
build_web_compilers: ^3.0.0
20+
build_web_compilers:
21+
git:
22+
url: https://github.com/dart-lang/build.git
23+
ref: legacy_force_opt_out
24+
path: build_web_compilers

fixtures/_webdevSmoke/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ environment:
1717

1818
dev_dependencies:
1919
build_runner: '>=1.6.2 <3.0.0'
20-
build_web_compilers: '>=2.12.0 <4.0.0'
20+
build_web_compilers:
21+
git:
22+
url: https://github.com/dart-lang/build.git
23+
ref: legacy_force_opt_out
24+
path: build_web_compilers

webdev/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
- Add `--enable-experiment` flag to webdev commands and pass it
44
to the build runner and the expression compiler service.
5+
- Prepare or Dart 3 alpha breaking changes:
6+
- Move weak null safety tests to special branch of `build_web_compilers`.
7+
- Do not pass `--(no)-sound-null-safety` flag to build daemon.
58

69
## 2.7.12
710

webdev/lib/src/command/shared.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ List<String> buildRunnerArgs(
8989
..add('build_web_compilers|ddc=generate-full-dill=true');
9090
}
9191

92-
if (configuration.nullSafety != nullSafetyAuto) {
93-
arguments
94-
..add('--define')
95-
..add('build_web_compilers:entrypoint=sound_null_safety='
96-
'${configuration.nullSafety == nullSafetySound}');
97-
}
98-
9992
for (var experiment in configuration.experiments) {
10093
arguments.add('--enable-experiment=$experiment');
10194
}

0 commit comments

Comments
 (0)