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

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

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 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/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 734ddb95db7808e5f54e4ca175de557ede530502..8e11da34fd44553388c53d9d5a48c826fa819a79 100644
--- a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
@@ -117,6 +117,12 @@ enum JsGetName {
/// Field name used for determining if an object or its interceptor has
/// JavaScript indexing behavior.
IS_INDEXABLE_FIELD_NAME,
+ /// String representation of the type of the null class.
+ NULL_CLASS_TYPE_NAME,
+ /// String representation of the type of the object class.
+ OBJECT_CLASS_TYPE_NAME,
+ /// String representation of the type of the function class.
+ FUNCTION_CLASS_TYPE_NAME,
}
enum JsBuiltin {
@@ -172,25 +178,13 @@ enum JsBuiltin {
/// JsBuiltin.isSubtype, other, type);
isSubtype,
- /// Returns true if the given type is _the_ `Function` type.
- /// That is, it returns true if the given [type] is exactly the `Function`
- /// type rti-encoding.
+ /// Returns true if the given type equals the type given as second
+ /// argument. Use the JS_GET_NAME helpers to get the type representation
+ /// for various Dart classes.
///
/// JS_BUILTIN('returns:bool;effects:none;depends:none',
- /// JsBuiltin.isFunctionTypeLiteral, type);
- isFunctionTypeRti,
-
- /// Returns whether the given type is _the_ null-type..
- ///
- /// JS_BUILTIN('returns:bool;effects:none;depends:none',
- /// JsBuiltin.isNullType, type);
- isNullTypeRti,
-
- /// Returns whether the given type is _the_ Dart Object type.
- ///
- /// JS_BUILTIN('returns:bool;effects:none;depends:none',
- /// JsBuiltin.isDartObjectType, type);
- isDartObjectTypeRti,
+ /// JsBuiltin.isFunctionTypeLiteral, type, name);
+ isGivenTypeRti,
/// Returns the metadata of the given [index].
///

Powered by Google App Engine
This is Rietveld 408576698