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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_rti.dart

Issue 14049034: Revert "Revert "Fix x.runtimeType for native classes"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index b8f4e7d3b618e939118ada736e7a661a3f595984..fd64f48144278759c59dc44513f79f1dc68821af 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -32,7 +32,7 @@ class TypeImpl implements Type {
}
String getClassName(var object) {
- return JS('String', r'#.constructor.builtin$cls', object);
+ return JS('String', r'#.constructor.builtin$cls', getInterceptor(object));
}
String getRuntimeTypeAsString(List runtimeType) {
@@ -80,6 +80,11 @@ String getRuntimeTypeString(var object) {
return "$className${joinArguments(typeInfo, 0)}";
}
+Type getRuntimeType(var object) {
+ String type = getRuntimeTypeString(object);
+ return new TypeImpl(type);
+}
+
bool isJsFunction(var o) => JS('bool', r'typeof # == "function"', o);
Object invoke(function, arguments) {

Powered by Google App Engine
This is Rietveld 408576698