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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_rti.dart

Issue 2735983003: Type of InstanceMirror on class should still be a ClassMirror when class has call method (Closed)
Patch Set: Created 3 years, 9 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/js_runtime/lib/js_mirrors.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_rti.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index 8ee404e4496207cb02cd657fac502177c8506476..c697b1018bfc98105cb8f7d15e6974ccefa7fabf 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -290,10 +290,14 @@ String joinArguments(var types, int startIndex,
* In minified mode does *not* use unminified identifiers (even when present).
*/
String getRuntimeTypeString(var object) {
- // Check for function type first, since non-tearoff closures look like classes
- // due to closure conversion.
- var functionRti = extractFunctionTypeObjectFrom(object);
- if (functionRti != null) return runtimeTypeToString(functionRti);
+ if (object is Closure) {
+ // This excludes classes that implement Function via a `call` method, but
+ // includes classes generated to represent closures in closure conversion.
+ var functionRti = extractFunctionTypeObjectFrom(object);
+ if (functionRti != null) {
+ return runtimeTypeToString(functionRti);
+ }
+ }
String className = getClassName(object);
if (object == null) return className;
String rtiName = JS_GET_NAME(JsGetName.RTI_NAME);
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_mirrors.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698