Chromium Code Reviews

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 2699073003: Support `void` as generic argument.
Patch Set: Add specialized messages for `void` for-ins. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 6e1548d396a3bb7cc40f13fa0de52e07bad54cc7..d80a72706f17ed9b4db173fff9b3f02d0a5b64f4 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -183,6 +183,14 @@ bool isNullTypeRti(type) {
JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME));
}
+/// Returns whether the given type is void type.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+bool isVoidType(rti) {
+ return JS_BUILTIN('returns:bool;effects:none;depends:none',
+ JsBuiltin.isVoidRti, rti);
+}
+
/// Returns the metadata of the given [index].
// TODO(floitsch): move this to foreign_helper.dart or similar.
@ForceInline()

Powered by Google App Engine