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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 1121313007: dart2js: add builtin 'isSubtype'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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: sdk/lib/_internal/compiler/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index 0421f365610b92aea8b99935f2183ec95cbb9855..06638615557098b8a4dd667ec2ef8d61e9e6f0de 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -62,7 +62,6 @@ import 'dart:_foreign_helper' show
JS_NULL_CLASS_NAME,
JS_OBJECT_CLASS_NAME,
JS_OPERATOR_AS_PREFIX,
- JS_OPERATOR_IS_PREFIX,
JS_SIGNATURE_NAME,
JS_STRING_CONCAT,
RAW_DART_FUNCTION_REF;
@@ -146,6 +145,14 @@ Object getRawRuntimeType(Object o) {
return JS_BUILTIN('', JsBuiltin.rawRuntimeType, o);
}
+/// Returns whether the given [type] is a subtype of [other].
+///
+/// The argument [other] is the name of the other type, as computed by
+/// [runtimeTypeToString].
+bool builtinIsSubtype(type, String other) {
+ return JS_BUILTIN('returns:bool;effects:none;depends:none',
+ JsBuiltin.isSubtype, other, type);
+}
/// No-op method that is called to inform the compiler that preambles might
/// be needed when executing the resulting JS file in a command-line
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/foreign_helper.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698