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

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

Issue 27529003: Revert "Reapply "Add TypeVariable object on runtime to support reflection on type variables." and "… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/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/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index d6bb7eef747e9b12a1fe958b5715685a8c8cbcb0..1b68a3a18b316a83a52ed100f29c7a32b8dba330 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -27,8 +27,7 @@ import 'dart:_js_helper' show
getMangledTypeName,
throwInvalidReflectionError,
hasReflectableProperty,
- runtimeTypeToString,
- TypeVariable;
+ runtimeTypeToString;
import 'dart:_interceptors' show
Interceptor,
JSExtendableArray;
@@ -182,13 +181,11 @@ abstract class JsDeclarationMirror extends JsMirror
}
class JsTypeVariableMirror extends JsTypeMirror implements TypeVariableMirror {
+ final TypeMirror upperBound;
final DeclarationMirror owner;
- final TypeVariable _typeVariable;
- TypeMirror _cachedUpperBound;
- JsTypeVariableMirror(TypeVariable typeVariable, this.owner)
- : this._typeVariable = typeVariable,
- super(s(typeVariable.name));
+ JsTypeVariableMirror(Symbol simpleName, this.upperBound, this.owner)
+ : super(simpleName);
bool operator ==(other) {
return (other is JsTypeVariableMirror &&
@@ -204,12 +201,6 @@ class JsTypeVariableMirror extends JsTypeMirror implements TypeVariableMirror {
}
String get _prettyName => 'TypeVariableMirror';
-
- TypeMirror get upperBound {
- if (_cachedUpperBound != null) return _cachedUpperBound;
- return _cachedUpperBound = typeMirrorFromRuntimeTypeRepresentation(
- JS('', 'init.metadata[#]', _typeVariable.bound));
- }
}
class JsTypeMirror extends JsDeclarationMirror implements TypeMirror {
@@ -836,7 +827,6 @@ class JsTypeBoundClassMirror implements ClassMirror {
List<TypeMirror> get typeArguments {
if (_typeArgs is! String) return _typeArgs;
List result = new List();
-
if (_typeArgs.indexOf('<') == -1) {
for (String s in _typeArgs.split(',')) {
result.add(reflectClassByMangledName(s.trim()));
@@ -1330,9 +1320,13 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
List typeVars =
JS('JSExtendableArray|Null', '#.prototype["<>"]', _jsConstructor);
if (typeVars == null) return result;
- for (int i = 0; i < typeVars.length; i++) {
- TypeVariable typeVariable = JS('', 'init.metadata[#]', typeVars[i]);
- result.add(new JsTypeVariableMirror(typeVariable, this));
+ for (int i = 0; i < typeVars.length; i += 2) {
+ TypeMirror upperBound =
+ typeMirrorFromRuntimeTypeRepresentation(JS('', 'init.metadata[#]',
+ typeVars[i+1]));
+ var typeMirror =
+ new JsTypeVariableMirror(s(typeVars[i]), upperBound, this);
+ result.add(typeMirror);
}
return _cachedTypeVariables = new UnmodifiableListView(result);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698