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

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

Issue 113193006: Handle dynamic as type argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r31967. Created 6 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 | « no previous file | dart/tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/dart/sdk/lib/_internal/lib/js_mirrors.dart b/dart/sdk/lib/_internal/lib/js_mirrors.dart
index df8769a2fc1a4f1a48d35f8222352a667a759fcc..5d077a4bfb7d70e8264a95443da48fbe21aef006 100644
--- a/dart/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/dart/sdk/lib/_internal/lib/js_mirrors.dart
@@ -516,6 +516,7 @@ TypeMirror reflectType(Type key) {
TypeMirror reflectClassByMangledName(String mangledName) {
String unmangledName = mangledGlobalNames[mangledName];
if (mangledName == 'dynamic') return JsMirrorSystem._dynamicType;
+ if (mangledName == 'void') return JsMirrorSystem._voidType;
if (unmangledName == null) unmangledName = mangledName;
return reflectClassByName(s(unmangledName), mangledName);
}
@@ -2386,8 +2387,17 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
var typeArgument = getTypeArgument(index);
if (typeArgument is JsTypeVariableMirror)
return '${typeArgument._metadataIndex}';
- assert(typeArgument is JsClassMirror ||
- typeArgument is JsTypeBoundClassMirror);
+ if (typeArgument is! JsClassMirror &&
+ typeArgument is! JsTypeBoundClassMirror) {
+ if (typeArgument == JsMirrorSystem._dynamicType) {
+ return 'dynamic';
+ } else if (typeArgument == JsMirrorSystem._voidType) {
+ return 'void';
+ } else {
+ // TODO(ahe): This case shouldn't happen.
+ return 'dynamic';
+ }
+ }
return typeArgument._mangledName;
}
representation =
« no previous file with comments | « no previous file | dart/tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698