Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dwds/test/fixtures/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ class TestContext {
String basePath = '';

_port = await findUnusedPort();
final soundNullSafety = nullSafety == NullSafety.sound;
switch (compilationMode) {
case CompilationMode.buildDaemon:
{
Expand All @@ -237,6 +238,8 @@ class TestContext {
'--define',
'build_web_compilers|ddc=generate-full-dill=true',
],
'--define',
'build_web_compilers:entrypoint=sound_null_safety=$soundNullSafety',
'--verbose',
];
_daemonClient =
Expand Down
10 changes: 0 additions & 10 deletions dwds/test/utils/version_compatibility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@
// 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 'dart:io';

import 'package:pub_semver/pub_semver.dart';

import '../fixtures/context.dart';

bool supportedMode(
{required CompilationMode compilationMode,
required NullSafety nullSafetyMode}) {
final isDart3 = Version.parse(Platform.version.split(' ')[0]).major == 3;
// TODO(https://github.com/dart-lang/webdev/issues/1818): Support compiling to
// to weak null-safety for both FrontendServer and BuildDaemon.
if (isDart3 && nullSafetyMode == NullSafety.weak) {
return false;
}
// TODO(https://github.com/dart-lang/webdev/issues/1591): Support compiling to
// sound null-safety for the FrontendServer.
if (compilationMode == CompilationMode.frontendServer &&
Expand Down
4 changes: 4 additions & 0 deletions frontend_server_common/lib/src/frontend_server_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ class ResidentCompiler {
required this.fileSystemRoots,
required this.fileSystemScheme,
required this.platformDill,
required this.soundNullSafety,
this.verbose = false,
CompilerMessageConsumer compilerMessageConsumer = defaultConsumer,
}) : _stdoutHandler = StdoutHandler(consumer: compilerMessageConsumer);
Expand All @@ -269,6 +270,7 @@ class ResidentCompiler {
final List<Uri> fileSystemRoots;
final String fileSystemScheme;
final String platformDill;
final bool soundNullSafety;
final bool verbose;

/// The path to the root of the Dart SDK used to compile.
Expand Down Expand Up @@ -386,6 +388,8 @@ class ResidentCompiler {
],
if (useDebuggerModuleNames) '--debugger-module-names',
'--experimental-emit-debug-metadata',
if (soundNullSafety) '--sound-null-safety',
if (!soundNullSafety) '--no-sound-null-safety',
if (verbose) '--verbose'
];

Expand Down
1 change: 1 addition & 0 deletions frontend_server_common/lib/src/resident_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ResidentWebRunner {
fileSystemRoots: fileSystemRoots,
fileSystemScheme: fileSystemScheme,
verbose: verbose,
soundNullSafety: soundNullSafety,
);
expressionCompiler = TestExpressionCompiler(generator);
}
Expand Down