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' |