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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart

Issue 64033002: Version 0.8.10.8 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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: dart/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
===================================================================
--- dart/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart (revision 30037)
+++ dart/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart (working copy)
@@ -293,6 +293,8 @@
String get simpleName => _element.name;
+ bool get isNameSynthetic => false;
+
/**
* Computes the first token for this declaration using the begin token of the
* element node or element position as indicator.
@@ -537,13 +539,7 @@
*/
String get simpleName {
if (_library.libraryTag != null) {
- // TODO(ahe): Remove StringNode check when old syntax is removed.
- StringNode name = _library.libraryTag.name.asStringNode();
- if (name != null) {
- return name.dartString.slowToString();
- } else {
- return _library.libraryTag.name.toString();
- }
+ return _library.libraryTag.name.toString();
} else {
// Use the file name as script name.
String path = _library.canonicalUri.path;
@@ -847,6 +843,23 @@
return null;
}
+ ClassMirror get mixin {
+ if (_class.isMixinApplication) {
+ MixinApplicationElement mixinApplication = _class;
+ return new Dart2JsInterfaceTypeMirror(mirrors,
+ mixinApplication.mixinType);
+ }
+ return this;
+ }
+
+ bool get isNameSynthetic {
+ if (_class.isMixinApplication) {
+ MixinApplicationElement mixinApplication = _class;
+ return mixinApplication.isUnnamedMixinApplication;
+ }
+ return false;
+ }
+
List<ClassMirror> get superinterfaces {
var list = <ClassMirror>[];
Link<DartType> link = _class.interfaces;
@@ -958,6 +971,10 @@
List<ClassMirror> get superinterfaces => const <ClassMirror>[];
+ // TODO(johnniwinther): Refactor [TypedefMirror] to not extend [ClassMirror]
+ // and remove this.
+ ClassMirror get mixin => this;
+
bool get isClass => false;
bool get isOriginalDeclaration => true;
@@ -1077,6 +1094,8 @@
InterfaceType get _interfaceType => _type;
+ bool get isNameSynthetic => originalDeclaration.isNameSynthetic;
+
String get qualifiedName => originalDeclaration.qualifiedName;
// TODO(johnniwinther): Substitute type arguments for type variables.
@@ -1096,6 +1115,14 @@
// TODO(johnniwinther): Substitute type arguments for type variables.
List<ClassMirror> get superinterfaces => originalDeclaration.superinterfaces;
+ // TODO(johnniwinther): Substitute type arguments for type variables.
+ ClassMirror get mixin {
+ if (originalDeclaration.mixin == originalDeclaration) {
+ return this;
+ }
+ return originalDeclaration.mixin;
+ }
+
bool get isClass => originalDeclaration.isClass;
bool get isAbstract => originalDeclaration.isAbstract;
@@ -1170,7 +1197,7 @@
List<ParameterMirror> _parameters;
Dart2JsFunctionTypeMirror(Dart2JsMirrorSystem system,
- FunctionType functionType, this._functionSignature)
+ FunctionType functionType, this._functionSignature)
: super(system, functionType) {
assert (_functionSignature != null);
}
@@ -1209,6 +1236,8 @@
// TODO(johnniwinther): Substitute type arguments for type variables.
List<ClassMirror> get superinterfaces => originalDeclaration.superinterfaces;
+ ClassMirror get mixin => this;
+
bool get isClass => originalDeclaration.isClass;
bool get isPrivate => originalDeclaration.isPrivate;

Powered by Google App Engine
This is Rietveld 408576698