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

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

Issue 10908142: Add runtimeType() to Object which returns canonicalized instances of Type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor. 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/core_patch.dart
diff --git a/lib/compiler/implementation/lib/core_patch.dart b/lib/compiler/implementation/lib/core_patch.dart
index 9d374415812fa5186686f1a06696c320f382030c..49e566299221f1896f4792beb3ac7589ef3d3534 100644
--- a/lib/compiler/implementation/lib/core_patch.dart
+++ b/lib/compiler/implementation/lib/core_patch.dart
@@ -23,6 +23,11 @@ patch class Object {
patch void noSuchMethod(String name, List args) {
throw new NoSuchMethodError(this, name, args);
}
+
+ patch Type runtimeType() {
+ String key = getRuntimeTypeString(this);
+ return getOrCreateCachedRuntimeType(key);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698