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

Unified Diff: sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart

Issue 954253002: dart2js: add compiler builtins to the core-runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad return type. (Also removes duplicate getInterceptor call). Created 5 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
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/native_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
index dff276d054e0b804629d243af8812a2e080daa7e..89768733d665fc4eea654dada17e79dbe33fbd93 100644
--- a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
@@ -87,3 +87,41 @@ enum JsGetName {
CALL_NAME_PROPERTY,
DEFERRED_ACTION_PROPERTY
}
+
+enum JsBuiltin {
+ /// Returns the JavaScript constructor function for Dart's Object class.
+ /// This can be used for type tests, as in
+ ///
+ /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor);
+ /// if (JS('bool', '# instanceof #', obj, constructor))
+ /// ...
+ dartObjectConstructor,
+
+ /// Returns true if the given type is a function type. Returns false for
+ /// the one `Function` type singleton. (See [isFunctionTypeSingleton]).
+ ///
+ /// JS_BUILTIN('bool', JsBuiltin.isFunctionType, o)
+ isFunctionType,
+
+ /// Returns true if the given type is the `Function` type literal.
+ ///
+ /// JS_BUILTIN('returns:bool;effects:none;depends:none',
+ /// JsBuiltin.isFunctionTypeLiteral, type);
+ isFunctionTypeLiteral,
+
+ /// Returns a new function type object.
+ ///
+ /// JS_BUILTIN('=Object', JsBuiltin.createFunctionType)
+ createFunctionType,
+
+ /// Returns the class name of the given type.
+ ///
+ /// JS_BUILTIN('String', JsBuiltin.typeName, type)
+ typeName,
+
+ /// Returns the raw runtime type of the given object. The given argument
+ /// [o] should be the interceptor (for non-Dart objects).
+ ///
+ /// JS_BUILTIN('', JsBuiltin.rawRuntimeType, o)
+ rawRuntimeType,
+}
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/native_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698