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

Unified Diff: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart

Issue 2855173002: Revert "Void is not required to be `null` anymore." (Closed)
Patch Set: Created 3 years, 8 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: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
diff --git a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
index d239c1aa9b7a0e027fe0d8ad08b697e3a762555a..571e10616765ff66da36876abf45b119b94b7f91 100644
--- a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
+++ b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
@@ -117,6 +117,7 @@ class CheckedModeHelpers {
/// All the checked mode helpers.
static const List<CheckedModeHelper> helpers = const <CheckedModeHelper>[
const MalformedCheckedModeHelper('checkMalformedType'),
+ const CheckedModeHelper('voidTypeCheck'),
const CheckedModeHelper('stringTypeCast'),
const CheckedModeHelper('stringTypeCheck'),
const CheckedModeHelper('doubleTypeCast'),
@@ -202,6 +203,12 @@ class CheckedModeHelpers {
return 'checkMalformedType';
}
+ if (type.isVoid) {
+ assert(!typeCast); // Cannot cast to void.
+ if (nativeCheckOnly) return null;
+ return 'voidTypeCheck';
+ }
+
if (type.isTypeVariable) {
return typeCast
? 'subtypeOfRuntimeTypeCast'
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_system.dart ('k') | pkg/compiler/lib/src/js_backend/impact_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698