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

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

Issue 2639733004: dart2js: Make .runtimeType work for tear-off closures (Closed)
Patch Set: line-wrap Created 3 years, 11 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_helper.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_rti.dart » ('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_mirrors.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
index 7489b217aa585a5608c2e1982c72af4c4b16c3ef..36924db217846fc3f13ca595865a730687b85e27 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
@@ -2803,6 +2803,10 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
DeclarationMirror owner, var /*int|List|JsFunction|TypeImpl*/ type) {
// TODO(ahe): This method might benefit from using convertRtiToRuntimeType
// instead of working on strings.
+ if (type == null) {
+ return JsMirrorSystem._dynamicType;
+ }
+
ClassMirror ownerClass;
DeclarationMirror context = owner;
while (context != null) {
@@ -2816,9 +2820,7 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
}
String representation;
- if (type == null) {
- return JsMirrorSystem._dynamicType;
- } else if (type is TypeImpl) {
+ if (type is TypeImpl) {
return reflectType(type);
} else if (ownerClass == null) {
representation = runtimeTypeToString(type);
@@ -2876,10 +2878,10 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
getMangledTypeName(createRuntimeType(representation)));
}
String typedefPropertyName = JS_GET_NAME(JsGetName.TYPEDEF_TAG);
- if (type != null && JS('', '#[#]', type, typedefPropertyName) != null) {
+ if (JS('', '#[#]', type, typedefPropertyName) != null) {
return typeMirrorFromRuntimeTypeRepresentation(
owner, JS('', '#[#]', type, typedefPropertyName));
- } else if (type != null && isDartFunctionType(type)) {
+ } else if (isDartFunctionType(type)) {
return new JsFunctionTypeMirror(type, owner);
}
return reflectClass(Function);
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698