Chromium Code Reviews| Index: lib/dartdoc/mirrors/dart2js_mirror.dart |
| diff --git a/lib/dartdoc/mirrors/dart2js_mirror.dart b/lib/dartdoc/mirrors/dart2js_mirror.dart |
| index 5f1f3d99d2e67bf60677bdf055c215179c1ab8cd..f041f7e6522b81f5099c6ffd10538425886944fe 100644 |
| --- a/lib/dartdoc/mirrors/dart2js_mirror.dart |
| +++ b/lib/dartdoc/mirrors/dart2js_mirror.dart |
| @@ -358,7 +358,7 @@ class Dart2JsCompilation implements Compilation { |
| _compiler.scanner.loadLibrary(uri, null); |
| } |
| - MirrorSystem mirrors() => new Dart2JsMirrorSystem(_compiler); |
| + MirrorSystem get mirrors() => new Dart2JsMirrorSystem(_compiler); |
| Future<String> compileToJavaScript() => |
| new Future<String>.immediate(_compiler.assembledCode); |
| @@ -394,15 +394,15 @@ abstract class Dart2JsElementMirror implements Dart2JsMirror { |
| assert (_element !== null); |
| } |
| - String simpleName() => _element.name.slowToString(); |
| + String get simpleName() => _element.name.slowToString(); |
| - Location location() => new Dart2JsLocation( |
| + Location get location() => new Dart2JsLocation( |
| _element.getCompilationUnit().script, |
| system.compiler.spanFromElement(_element)); |
| String toString() => _element.toString(); |
| - int hashCode() => qualifiedName().hashCode(); |
| + int hashCode() => qualifiedName.hashCode(); |
| } |
| abstract class Dart2JsProxyMirror implements Dart2JsMirror { |
| @@ -410,7 +410,7 @@ abstract class Dart2JsProxyMirror implements Dart2JsMirror { |
| Dart2JsProxyMirror(this.system); |
| - int hashCode() => qualifiedName().hashCode(); |
| + int hashCode() => qualifiedName.hashCode(); |
| } |
| //------------------------------------------------------------------------------ |
| @@ -436,7 +436,7 @@ class Dart2JsMirrorSystem implements MirrorSystem, Dart2JsMirror { |
| } |
| } |
| - Map<Object, LibraryMirror> libraries() { |
| + Map<Object, LibraryMirror> get libraries() { |
| _ensureLibraries(); |
| return new ImmutableMapWrapper<Object, LibraryMirror>(_libraries); |
| } |
| @@ -447,13 +447,13 @@ class Dart2JsMirrorSystem implements MirrorSystem, Dart2JsMirror { |
| Dart2JsMirrorSystem get system() => this; |
| - String simpleName() => "mirror"; |
| - String qualifiedName() => simpleName(); |
| + String get simpleName() => "mirror"; |
| + String get qualifiedName() => simpleName; |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| // TODO(johnniwinther): Hack! Dart2JsMirrorSystem need not be a Mirror. |
| - int hashCode() => qualifiedName().hashCode(); |
| + int hashCode() => qualifiedName.hashCode(); |
| } |
| abstract class Dart2JsObjectMirror extends Dart2JsElementMirror |
| @@ -474,14 +474,14 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror |
| LibraryMirror library() => this; |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| /** |
| * Returns the library name (for libraries with a #library tag) or the script |
| * file name (for scripts without a #library tag). The latter case is used to |
| * provide a 'library name' for scripts, to use for instance in dartdoc. |
| */ |
| - String simpleName() { |
| + String get simpleName() { |
| if (_library.libraryTag !== null) { |
| return _library.libraryTag.argument.dartString.slowToString(); |
| } else { |
| @@ -491,7 +491,7 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror |
| } |
| } |
| - String qualifiedName() => simpleName(); |
| + String get qualifiedName() => simpleName; |
| void _ensureTypes() { |
| if (_types == null) { |
| @@ -523,17 +523,17 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror |
| } |
| } |
| - Map<Object, MemberMirror> declaredMembers() { |
| + Map<Object, MemberMirror> get declaredMembers() { |
| _ensureMembers(); |
| return new ImmutableMapWrapper<Object, MemberMirror>(_members); |
| } |
| - Map<Object, InterfaceMirror> types() { |
| + Map<Object, InterfaceMirror> get types() { |
| _ensureTypes(); |
| return new ImmutableMapWrapper<Object, InterfaceMirror>(_types); |
| } |
| - Location location() { |
| + Location get location() { |
| var script = _library.getCompilationUnit().script; |
| return new Dart2JsLocation( |
| script, |
| @@ -547,11 +547,13 @@ class Dart2JsLocation implements Location { |
| Dart2JsLocation(this._script, this._span); |
| - int start() => _span.begin; |
| - int end() => _span.end; |
| - Source source() => new Dart2JsSource(_script); |
| + int get start() => _span.begin; |
| - String text() => _script.text.substring(start(), end()); |
| + int get end() => _span.end; |
| + |
| + Source get source() => new Dart2JsSource(_script); |
| + |
| + String get text() => _script.text.substring(start, end); |
| } |
| class Dart2JsSource implements Source { |
| @@ -559,8 +561,9 @@ class Dart2JsSource implements Source { |
| Dart2JsSource(this._script); |
| - Uri uri() => _script.uri; |
| - String text() => _script.text; |
| + Uri get uri() => _script.uri; |
| + |
| + String get text() => _script.text; |
| } |
| class Dart2JsParameterMirror extends Dart2JsElementMirror |
| @@ -588,32 +591,32 @@ class Dart2JsParameterMirror extends Dart2JsElementMirror |
| VariableElement get _variableElement() => _element; |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| - String qualifiedName() => '${_method.qualifiedName()}#${simpleName()}'; |
| + String get qualifiedName() => '${_method.qualifiedName}#${simpleName}'; |
| - TypeMirror type() => _convertTypeToTypeMirror(system, |
| + TypeMirror get type() => _convertTypeToTypeMirror(system, |
| _variableElement.computeType(system.compiler), |
| system.compiler.dynamicClass.computeType(system.compiler), |
| _variableElement.variables.functionSignature); |
| - String defaultValue() { |
| - if (hasDefaultValue()) { |
| + String get defaultValue() { |
| + if (hasDefaultValue) { |
| SendSet expression = _variableElement.cachedNode.asSendSet(); |
| return expression.arguments.head.unparse(); |
| } |
| return null; |
| } |
| - bool hasDefaultValue() { |
| + bool get hasDefaultValue() { |
| return _variableElement.cachedNode !== null && |
| _variableElement.cachedNode is SendSet; |
| } |
| - bool isOptional() => _isOptional; |
| + bool get isOptional() => _isOptional; |
|
turnidge
2012/08/09 17:44:13
This could be made a final bool field instead of a
Johnni Winther
2012/08/10 23:40:23
Done.
|
| - bool isInitializingFormal() => false; |
| + bool get isInitializingFormal() => false; |
| - FieldMirror initializedField() => null; |
| + FieldMirror get initializedField() => null; |
| } |
| class Dart2JsFieldParameterMirror extends Dart2JsParameterMirror { |
| @@ -626,9 +629,9 @@ class Dart2JsFieldParameterMirror extends Dart2JsParameterMirror { |
| FieldParameterElement get _fieldParameterElement() => _element; |
| - TypeMirror type() { |
| + TypeMirror get type() { |
| if (_fieldParameterElement.variables.cachedNode.type !== null) { |
| - return super.type(); |
| + return super.type; |
| } |
| return _convertTypeToTypeMirror(system, |
| _fieldParameterElement.fieldElement.computeType(system.compiler), |
| @@ -636,10 +639,10 @@ class Dart2JsFieldParameterMirror extends Dart2JsParameterMirror { |
| _variableElement.variables.functionSignature); |
| } |
| - bool isInitializingFormal() => true; |
| + bool get isInitializingFormal() => true; |
| - FieldMirror initializedField() => new Dart2JsFieldMirror( |
| - _method.surroundingDeclaration(), _fieldParameterElement.fieldElement); |
| + FieldMirror get initializedField() => new Dart2JsFieldMirror( |
| + _method.surroundingDeclaration, _fieldParameterElement.fieldElement); |
| } |
| //------------------------------------------------------------------------------ |
| @@ -663,11 +666,11 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| : this._library = library, |
| super(library.system, _class); |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| - String qualifiedName() => '${library().qualifiedName()}.${simpleName()}'; |
| + String get qualifiedName() => '${library.qualifiedName}.${simpleName}'; |
| - Location location() { |
| + Location get location() { |
| if (_class is PartialClassElement) { |
| var node = _class.parseNode(_diagnosticListener); |
| if (node !== null) { |
| @@ -676,7 +679,7 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| return new Dart2JsLocation(script, span); |
| } |
| } |
| - return super.location(); |
| + return super.location; |
| } |
| void _ensureMembers() { |
| @@ -695,12 +698,12 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| } |
| } |
| - Map<Object, MemberMirror> declaredMembers() { |
| + Map<Object, MemberMirror> get declaredMembers() { |
| _ensureMembers(); |
| return new ImmutableMapWrapper<Object, MemberMirror>(_members); |
| } |
| - LibraryMirror library() { |
| + LibraryMirror get library() { |
|
turnidge
2012/08/09 17:44:13
Ditto here. You get the idea. Again, your call.
Johnni Winther
2012/08/10 23:40:23
Done.
|
| return _library; |
| } |
| @@ -718,14 +721,14 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| InterfaceMirror get declaration() => this; |
| - InterfaceMirror superclass() { |
| + InterfaceMirror get superclass() { |
| if (_class.supertype != null) { |
| return new Dart2JsInterfaceTypeMirror(system, _class.supertype); |
| } |
| return null; |
| } |
| - Map<Object, InterfaceMirror> interfaces() { |
| + Map<Object, InterfaceMirror> get interfaces() { |
| var map = new Map<String, InterfaceMirror>(); |
| Link<Type> link = _class.interfaces; |
| while (!link.isEmpty()) { |
| @@ -741,16 +744,16 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| bool get isInterface() => _class.isInterface(); |
| - bool get isPrivate() => _isPrivate(simpleName()); |
| + bool get isPrivate() => _isPrivate(simpleName); |
| bool get isDeclaration() => true; |
| - List<TypeMirror> typeArguments() { |
| + List<TypeMirror> get typeArguments() { |
| throw new UnsupportedOperationException( |
| 'Declarations do not have type arguments'); |
| } |
| - List<TypeVariableMirror> typeVariables() { |
| + List<TypeVariableMirror> get typeVariables() { |
| if (_typeVariables == null) { |
| _typeVariables = <TypeVariableMirror>[]; |
| _class.ensureResolved(system.compiler); |
| @@ -762,7 +765,7 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| return _typeVariables; |
| } |
| - Map<Object, MethodMirror> constructors() { |
| + Map<Object, MethodMirror> get constructors() { |
| _ensureMembers(); |
| return new AsFilteredImmutableMap<Object, MemberMirror, MethodMirror>( |
| _members, (m) => m.isConstructor ? m : null); |
| @@ -771,7 +774,7 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| /** |
| * Returns the default type for this interface. |
| */ |
| - InterfaceMirror defaultType() { |
| + InterfaceMirror get defaultType() { |
| if (_class.defaultClass != null) { |
| return new Dart2JsInterfaceTypeMirror(system, _class.defaultClass); |
| } |
| @@ -785,13 +788,13 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror |
| if (other is! InterfaceMirror) { |
| return false; |
| } |
| - if (library() != other.library()) { |
| + if (library != other.library) { |
| return false; |
| } |
| if (isDeclaration !== other.isDeclaration) { |
| return false; |
| } |
| - return qualifiedName() == other.qualifiedName(); |
| + return qualifiedName == other.qualifiedName; |
| } |
| } |
| @@ -812,21 +815,21 @@ class Dart2JsTypedefMirror extends Dart2JsElementMirror |
| TypedefElement get _typedef() => _element; |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| - String qualifiedName() => '${library().qualifiedName()}.${simpleName()}'; |
| + String get qualifiedName() => '${library.qualifiedName}.${simpleName}'; |
| - Location location() { |
| + Location get location() { |
| var node = _typedef.parseNode(_diagnosticListener); |
| if (node !== null) { |
| var script = _typedef.getCompilationUnit().script; |
| var span = system.compiler.spanFromNode(node, script.uri); |
| return new Dart2JsLocation(script, span); |
| } |
| - return super.location(); |
| + return super.location; |
| } |
| - LibraryMirror library() => _library; |
| + LibraryMirror get library() => _library; |
| bool get isObject() => false; |
| @@ -840,12 +843,12 @@ class Dart2JsTypedefMirror extends Dart2JsElementMirror |
| bool get isFunction() => false; |
| - List<TypeMirror> typeArguments() { |
| + List<TypeMirror> get typeArguments() { |
| throw new UnsupportedOperationException( |
| 'Declarations do not have type arguments'); |
| } |
| - List<TypeVariableMirror> typeVariables() { |
| + List<TypeVariableMirror> get typeVariables() { |
| if (_typeVariables == null) { |
| _typeVariables = <TypeVariableMirror>[]; |
| // TODO(johnniwinther): Equip [Typedef] with a [typeParameters] map, just |
| @@ -854,7 +857,7 @@ class Dart2JsTypedefMirror extends Dart2JsElementMirror |
| return _typeVariables; |
| } |
| - TypeMirror definition() { |
| + TypeMirror get definition() { |
| if (_definition === null) { |
| // TODO(johnniwinther): Provide access to the functionSignature of the |
| // aliased function definition. |
| @@ -862,26 +865,26 @@ class Dart2JsTypedefMirror extends Dart2JsElementMirror |
| return _definition; |
| } |
| - Map<Object, MemberMirror> declaredMembers() => const <MemberMirror>{}; |
| + Map<Object, MemberMirror> get declaredMembers() => const <MemberMirror>{}; |
| InterfaceMirror get declaration() => this; |
| // TODO(johnniwinther): How should a typedef respond to these? |
| - InterfaceMirror superclass() => null; |
| + InterfaceMirror get superclass() => null; |
| - Map<Object, InterfaceMirror> interfaces() => const <InterfaceMirror>{}; |
| + Map<Object, InterfaceMirror> get interfaces() => const <InterfaceMirror>{}; |
| bool get isClass() => false; |
| bool get isInterface() => false; |
| - bool get isPrivate() => _isPrivate(simpleName()); |
| + bool get isPrivate() => _isPrivate(simpleName); |
| bool get isDeclaration() => true; |
| - Map<Object, MethodMirror> constructors() => const <MethodMirror>{}; |
| + Map<Object, MethodMirror> get constructors() => const <MethodMirror>{}; |
| - InterfaceMirror defaultType() => null; |
| + InterfaceMirror get defaultType() => null; |
| } |
| class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
| @@ -897,9 +900,9 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
| } |
| - String qualifiedName() => '${declarer().qualifiedName()}.${simpleName()}'; |
| + String get qualifiedName() => '${declarer.qualifiedName}.${simpleName}'; |
| - InterfaceMirror declarer() { |
| + InterfaceMirror get declarer() { |
| if (_declarer === null) { |
| if (_typeVariableType.element.enclosingElement.isClass()) { |
| _declarer = new Dart2JsInterfaceMirror(system, |
| @@ -912,7 +915,7 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
| return _declarer; |
| } |
| - LibraryMirror library() => declarer().library(); |
| + LibraryMirror get library() => declarer.library; |
| bool get isObject() => false; |
| @@ -926,7 +929,7 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
| bool get isFunction() => false; |
| - TypeMirror bound() => _convertTypeToTypeMirror( |
| + TypeMirror get bound() => _convertTypeToTypeMirror( |
| system, |
| _typeVariableType.element.bound, |
| system.compiler.objectClass.computeType(system.compiler)); |
| @@ -938,10 +941,10 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
| if (other is! TypeVariableMirror) { |
| return false; |
| } |
| - if (declarer() != other.declarer()) { |
| + if (declarer != other.declarer) { |
| return false; |
| } |
| - return qualifiedName() == other.qualifiedName(); |
| + return qualifiedName == other.qualifiedName; |
| } |
| } |
| @@ -957,17 +960,17 @@ abstract class Dart2JsTypeElementMirror extends Dart2JsProxyMirror |
| Dart2JsTypeElementMirror(Dart2JsMirrorSystem system, this._type) |
| : super(system); |
| - String simpleName() => _type.name.slowToString(); |
| + String get simpleName() => _type.name.slowToString(); |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| - Location location() { |
| + Location get location() { |
| var script = _type.element.getCompilationUnit().script; |
| return new Dart2JsLocation(script, |
| system.compiler.spanFromElement(_type.element)); |
| } |
| - LibraryMirror library() { |
| + LibraryMirror get library() { |
| return system.getLibrary(_type.element.getLibrary()); |
| } |
| @@ -984,10 +987,10 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
| InterfaceType get _interfaceType() => _type; |
| - String qualifiedName() => declaration.qualifiedName(); |
| + String get qualifiedName() => declaration.qualifiedName; |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - Map<Object, MemberMirror> declaredMembers() => declaration.declaredMembers(); |
| + Map<Object, MemberMirror> get declaredMembers() => declaration.declaredMembers; |
| bool get isObject() => system.compiler.objectClass == _type.element; |
| @@ -1005,10 +1008,10 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
| => new Dart2JsInterfaceMirror(system, _type.element); |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - InterfaceMirror superclass() => declaration.superclass(); |
| + InterfaceMirror get superclass() => declaration.superclass; |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - Map<Object, InterfaceMirror> interfaces() => declaration.interfaces(); |
| + Map<Object, InterfaceMirror> get interfaces() => declaration.interfaces; |
| bool get isClass() => declaration.isClass; |
| @@ -1018,7 +1021,7 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
| bool get isDeclaration() => false; |
| - List<TypeMirror> typeArguments() { |
| + List<TypeMirror> get typeArguments() { |
| if (_typeArguments == null) { |
| _typeArguments = <TypeMirror>[]; |
| Link<Type> type = _interfaceType.arguments; |
| @@ -1031,13 +1034,13 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
| return _typeArguments; |
| } |
| - List<TypeVariableMirror> typeVariables() => declaration.typeVariables(); |
| + List<TypeVariableMirror> get typeVariables() => declaration.typeVariables; |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - Map<Object, MethodMirror> constructors() => declaration.constructors(); |
| + Map<Object, MethodMirror> get constructors() => declaration.constructors; |
| // TODO(johnniwinther): Substitute type arguments for type variables? |
| - InterfaceMirror defaultType() => declaration.defaultType(); |
| + InterfaceMirror get defaultType() => declaration.defaultType; |
| bool operator ==(Object other) { |
| if (this === other) { |
| @@ -1052,8 +1055,8 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
| if (declaration != other.declaration) { |
| return false; |
| } |
| - var thisTypeArguments = typeArguments().iterator(); |
| - var otherTypeArguments = other.typeArguments().iterator(); |
| + var thisTypeArguments = typeArguments.iterator(); |
| + var otherTypeArguments = other.typeArguments.iterator(); |
| while (thisTypeArguments.hasNext() && otherTypeArguments.hasNext()) { |
| if (thisTypeArguments.next() != otherTypeArguments.next()) { |
| return false; |
| @@ -1078,20 +1081,20 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror |
| FunctionType get _functionType() => _type; |
| // TODO(johnniwinther): Is this the qualified name of a function type? |
| - String qualifiedName() => declaration.qualifiedName(); |
| + String get qualifiedName() => declaration.qualifiedName; |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - Map<Object, MemberMirror> declaredMembers() { |
| - var method = callMethod(); |
| + Map<Object, MemberMirror> get declaredMembers() { |
| + var method = callMethod; |
| if (method !== null) { |
| var map = new Map<String, MemberMirror>.from( |
| - declaration.declaredMembers()); |
| - var name = method.qualifiedName(); |
| + declaration.declaredMembers); |
| + var name = method.qualifiedName; |
| map[name] = method; |
| Function func = null; |
| return new ImmutableMapWrapper<Object, MemberMirror>(map); |
| } |
| - return declaration.declaredMembers(); |
| + return declaration.declaredMembers; |
| } |
| bool get isObject() => system.compiler.objectClass == _type.element; |
| @@ -1106,7 +1109,7 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror |
| bool get isFunction() => true; |
| - MethodMirror callMethod() => _convertElementMethodToMethodMirror( |
| + MethodMirror get callMethod() => _convertElementMethodToMethodMirror( |
| system.getLibrary(_functionType.element.getLibrary()), |
| _functionType.element); |
| @@ -1114,10 +1117,10 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror |
| => new Dart2JsInterfaceMirror(system, system.compiler.functionClass); |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - InterfaceMirror superclass() => declaration.superclass(); |
| + InterfaceMirror get superclass() => declaration.superclass; |
| // TODO(johnniwinther): Substitute type arguments for type variables. |
| - Map<Object, InterfaceMirror> interfaces() => declaration.interfaces(); |
| + Map<Object, InterfaceMirror> get interfaces() => declaration.interfaces; |
| bool get isClass() => declaration.isClass; |
| @@ -1127,22 +1130,22 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror |
| bool get isDeclaration() => false; |
| - List<TypeMirror> typeArguments() => const <TypeMirror>[]; |
| + List<TypeMirror> get typeArguments() => const <TypeMirror>[]; |
| - List<TypeVariableMirror> typeVariables() => declaration.typeVariables(); |
| + List<TypeVariableMirror> get typeVariables() => declaration.typeVariables; |
| - Map<Object, MethodMirror> constructors() => <MethodMirror>{}; |
| + Map<Object, MethodMirror> get constructors() => <MethodMirror>{}; |
| - InterfaceMirror defaultType() => null; |
| + InterfaceMirror get defaultType() => null; |
| - TypeMirror returnType() { |
| + TypeMirror get returnType() { |
| return _convertTypeToTypeMirror(system, _functionType.returnType, |
| system.compiler.dynamicClass.computeType(system.compiler)); |
| } |
| - List<ParameterMirror> parameters() { |
| + List<ParameterMirror> get parameters() { |
| if (_parameters === null) { |
| - _parameters = _parametersFromFunctionSignature(system, callMethod(), |
| + _parameters = _parametersFromFunctionSignature(system, callMethod, |
| _functionSignature); |
| } |
| return _parameters; |
| @@ -1156,17 +1159,17 @@ class Dart2JsVoidMirror extends Dart2JsTypeElementMirror { |
| VoidType get _voidType() => _type; |
| - String qualifiedName() => simpleName(); |
| + String get qualifiedName() => simpleName; |
| /** |
| * The void type has no location. |
| */ |
| - Location location() => null; |
| + Location get location() => null; |
| /** |
| * The void type has no library. |
| */ |
| - LibraryMirror getLibrary() => null; |
| + LibraryMirror get library() => null; |
| bool get isObject() => false; |
| @@ -1262,14 +1265,14 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror |
| FunctionElement get _function() => _element; |
| - String simpleName() => _name; |
| + String get simpleName() => _name; |
| - String qualifiedName() |
| - => '${surroundingDeclaration().qualifiedName()}.$canonicalName'; |
| + String get qualifiedName() |
| + => '${surroundingDeclaration.qualifiedName}.$canonicalName'; |
| String get canonicalName() => _canonicalName; |
| - ObjectMirror surroundingDeclaration() => _objectMirror; |
| + ObjectMirror get surroundingDeclaration() => _objectMirror; |
| bool get isTopLevel() => _objectMirror is LibraryMirror; |
| @@ -1280,17 +1283,17 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror |
| bool get isMethod() => !isConstructor; |
| - bool get isPrivate() => _isPrivate(simpleName()); |
| + bool get isPrivate() => _isPrivate(simpleName); |
| bool get isStatic() => |
| _function.modifiers !== null && _function.modifiers.isStatic(); |
| - List<ParameterMirror> parameters() { |
| + List<ParameterMirror> get parameters() { |
| return _parametersFromFunctionSignature(system, this, |
| _function.computeSignature(system.compiler)); |
| } |
| - TypeMirror returnType() => _convertTypeToTypeMirror( |
| + TypeMirror get returnType() => _convertTypeToTypeMirror( |
| system, _function.computeSignature(system.compiler).returnType, |
| system.compiler.dynamicClass.computeType(system.compiler)); |
| @@ -1308,14 +1311,14 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror |
| String get operatorName() => _operatorName; |
| - Location location() { |
| + Location get location() { |
| var node = _function.parseNode(_diagnosticListener); |
| if (node !== null) { |
| var script = _function.getCompilationUnit().script; |
| var span = system.compiler.spanFromNode(node, script.uri); |
| return new Dart2JsLocation(script, span); |
| } |
| - return super.location(); |
| + return super.location; |
| } |
| } |
| @@ -1331,12 +1334,12 @@ class Dart2JsFieldMirror extends Dart2JsElementMirror |
| this._variable = variable, |
| super(objectMirror.system, variable); |
| - String qualifiedName() |
| - => '${surroundingDeclaration().qualifiedName()}.$canonicalName'; |
| + String get qualifiedName() |
| + => '${surroundingDeclaration.qualifiedName}.$canonicalName'; |
| - String get canonicalName() => simpleName(); |
| + String get canonicalName() => simpleName; |
| - ObjectMirror surroundingDeclaration() => _objectMirror; |
| + ObjectMirror get surroundingDeclaration() => _objectMirror; |
| bool get isTopLevel() => _objectMirror is LibraryMirror; |
| @@ -1346,17 +1349,17 @@ class Dart2JsFieldMirror extends Dart2JsElementMirror |
| bool get isMethod() => false; |
| - bool get isPrivate() => _isPrivate(simpleName()); |
| + bool get isPrivate() => _isPrivate(simpleName); |
| bool get isStatic() => _variable.modifiers.isStatic(); |
| bool get isFinal() => _variable.modifiers.isFinal(); |
| - TypeMirror type() => _convertTypeToTypeMirror(system, |
| + TypeMirror get type() => _convertTypeToTypeMirror(system, |
| _variable.computeType(system.compiler), |
| system.compiler.dynamicClass.computeType(system.compiler)); |
| - Location location() { |
| + Location get location() { |
| var script = _variable.getCompilationUnit().script; |
| var node = _variable.variables.parseNode(_diagnosticListener); |
| if (node !== null) { |