Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: lib/strong_mode.dart

Issue 1396993002: housecleaning: remove nonnullableTypes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/strong_mode.dart
diff --git a/lib/strong_mode.dart b/lib/strong_mode.dart
index f1ef58c4c4d4d245d37530636d11f3a912aa1464..eb0091a0c5931d79fec815b7d7913b0fd0d1219b 100644
--- a/lib/strong_mode.dart
+++ b/lib/strong_mode.dart
@@ -108,10 +108,6 @@ class StrongModeOptions {
/// Whether to inject casts between Dart assignable types.
final bool relaxedCasts;
- /// A list of non-nullable type names (e.g., 'int')
- final List<String> nonnullableTypes;
- static const List<String> NONNULLABLE_TYPES = const <String>[];
-
/// Whether to include hints about dynamic invokes and runtime checks.
// TODO(jmesserly): this option is not used yet by DDC server mode or batch
// compile to JS.
@@ -122,16 +118,13 @@ class StrongModeOptions {
this.inferTransitively: inferTransitivelyDefault,
this.onlyInferConstsAndFinalFields: onlyInferConstAndFinalFieldsDefault,
this.inferDownwards: inferDownwardsDefault,
- this.relaxedCasts: true,
- this.nonnullableTypes: StrongModeOptions.NONNULLABLE_TYPES});
+ this.relaxedCasts: true});
StrongModeOptions.fromArguments(ArgResults args, {String prefix: ''})
: relaxedCasts = args[prefix + 'relaxed-casts'],
inferDownwards = args[prefix + 'infer-downwards'],
inferTransitively = args[prefix + 'infer-transitively'],
onlyInferConstsAndFinalFields = args[prefix + 'infer-only-finals'],
- nonnullableTypes = _optionsToList(args[prefix + 'nonnullable'],
- defaultValue: StrongModeOptions.NONNULLABLE_TYPES),
hints = args[prefix + 'hints'];
static ArgParser addArguments(ArgParser parser,
@@ -170,19 +163,6 @@ class StrongModeOptions {
return inferTransitively == s.inferTransitively &&
onlyInferConstsAndFinalFields == s.onlyInferConstsAndFinalFields &&
inferDownwards == s.inferDownwards &&
- relaxedCasts == s.relaxedCasts &&
- nonnullableTypes.length == s.nonnullableTypes.length &&
- new Set.from(nonnullableTypes).containsAll(s.nonnullableTypes);
- }
-}
-
-List<String> _optionsToList(String option,
- {List<String> defaultValue: const <String>[]}) {
- if (option == null) {
- return defaultValue;
- } else if (option.isEmpty) {
- return <String>[];
- } else {
- return option.split(',');
+ relaxedCasts == s.relaxedCasts;
}
}

Powered by Google App Engine
This is Rietveld 408576698