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

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

Issue 416643002: Support typedefs in function signatures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update mirrors used test. Created 6 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: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index c54dc57cb3d3f28492c5eaa7170b8219b2b39a80..70f37ea7214b51fba374511f1ac68b3fc030490d 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -2693,6 +2693,8 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
String representation;
if (type == null) {
return JsMirrorSystem._dynamicType;
+ } else if (type is Type) {
+ return reflectType(type);
} else if (ownerClass == null) {
representation = runtimeTypeToString(type);
} else if (ownerClass.isOriginalDeclaration) {
@@ -2748,6 +2750,12 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
return reflectClassByMangledName(
getMangledTypeName(createRuntimeType(representation)));
}
+ if (type != null && JS('Object|Null', '#.typedef', type) != null) {
+ return typeMirrorFromRuntimeTypeRepresentation(
+ owner, JS('Object', '#.typedef', type));
+ } else if (type != null && JS('Object|Null', '#.func', type) != null) {
+ return new JsFunctionTypeMirror(type, owner);
+ }
return reflectClass(Function);
}

Powered by Google App Engine
This is Rietveld 408576698