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

Unified Diff: lib/compiler/implementation/lib/interceptors.dart

Issue 10941031: Reapply 'Add runtimeType() to Object which returns canonicalized instances of Type'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: lib/compiler/implementation/lib/interceptors.dart
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart
index 17f8e51fa7534f2f73ef37a3575a80029513cf7a..64415a19d1e1c2ec25d01ec9fe184afade15c442 100644
--- a/lib/compiler/implementation/lib/interceptors.dart
+++ b/lib/compiler/implementation/lib/interceptors.dart
@@ -640,3 +640,17 @@ isOdd(receiver) {
}
get$toString(receiver) => () => toString(receiver);
+
+runtimeType(receiver) {
+ if (receiver is int) {
+ return getOrCreateCachedRuntimeType('int');
+ } else if (receiver is String) {
+ return getOrCreateCachedRuntimeType('String');
+ } else if (receiver is double) {
+ return getOrCreateCachedRuntimeType('double');
+ } else if (receiver is List) {
+ return getOrCreateCachedRuntimeType('List');
+ } else {
+ return UNINTERCEPTED(receiver.runtimeType());
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698