Skip to content

Commit baf740e

Browse files
alexmarkovcommit-bot@chromium.org
authored andcommitted
[vm/nnbd] Remove obsolete --null-safety option
Option --null-safety was replaced with --sound-null-safety (in https://dart-review.googlesource.com/c/sdk/+/153660). This change cleans up obsolete option from the VM and kernel compilers. Issue: dart-lang/sdk#41853 Change-Id: I605703bd5bf526391b21704b842bb9e6ca452061 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155020 Reviewed-by: Régis Crelier <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent b8c2cd4 commit baf740e

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

pkg/frontend_server/lib/frontend_server.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ ArgParser argParser = ArgParser(allowTrailingOptions: true)
156156
help: 'Whether asserts will be enabled.', defaultsTo: false)
157157
..addFlag('sound-null-safety',
158158
help: 'Respect the nullability of types at runtime.', defaultsTo: null)
159-
// TODO(alexmarkov) Remove obsolete --null-safety option.
160-
..addFlag('null-safety',
161-
help: 'Deprecated. Please use --sound-null-safety instead.',
162-
hide: true,
163-
defaultsTo: null)
164159
..addMultiOption('enable-experiment',
165160
help: 'Comma separated list of experimental features, eg set-literals.',
166161
hide: true)
@@ -410,8 +405,7 @@ class FrontendCompiler implements CompilerInterface {
410405
final String platformKernelDill =
411406
options['platform'] ?? 'platform_strong.dill';
412407
final String packagesOption = _options['packages'];
413-
final bool nullSafety =
414-
_options['sound-null-safety'] ?? _options['null-safety'];
408+
final bool nullSafety = _options['sound-null-safety'];
415409
final CompilerOptions compilerOptions = CompilerOptions()
416410
..sdkRoot = sdkRoot
417411
..fileSystem = _fileSystem

pkg/vm/lib/kernel_front_end.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ void declareCompilerOptions(ArgParser args) {
120120
help: 'Whether asserts will be enabled.', defaultsTo: false);
121121
args.addFlag('sound-null-safety',
122122
help: 'Respect the nullability of types at runtime.', defaultsTo: null);
123-
// TODO(alexmarkov) Remove obsolete --null-safety option.
124-
args.addFlag('null-safety',
125-
help: 'Deprecated. Please use --sound-null-safety instead.',
126-
hide: true,
127-
defaultsTo: null);
128123
args.addFlag('split-output-by-packages',
129124
help:
130125
'Split resulting kernel file into multiple files (one per package).',
@@ -192,8 +187,7 @@ Future<int> runCompiler(ArgResults options, String usage) async {
192187
final bool genBytecode = options['gen-bytecode'];
193188
final bool dropAST = options['drop-ast'];
194189
final bool enableAsserts = options['enable-asserts'];
195-
final bool nullSafety =
196-
options['sound-null-safety'] ?? options['null-safety'];
190+
final bool nullSafety = options['sound-null-safety'];
197191
final bool useProtobufTreeShaker = options['protobuf-tree-shaker'];
198192
final bool useProtobufTreeShakerV2 = options['protobuf-tree-shaker-v2'];
199193
final bool splitOutputByPackages = options['split-output-by-packages'];

runtime/vm/isolate.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ DEFINE_FLAG_HANDLER(SoundNullSafetyHandler,
9898
sound_null_safety,
9999
"Respect the nullability of types at runtime.");
100100

101-
// TODO(alexmarkov) Remove obsolete --null-safety option.
102-
DEFINE_FLAG_HANDLER(SoundNullSafetyHandler,
103-
null_safety,
104-
"Respect the nullability of types at runtime.");
105-
106101
DEFINE_FLAG(bool,
107102
disable_thread_pool_limit,
108103
false,

0 commit comments

Comments
 (0)