OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * This library is capable of producing linked summaries from unlinked | 6 * This library is capable of producing linked summaries from unlinked |
7 * ones (or prelinked ones). It functions by building a miniature | 7 * ones (or prelinked ones). It functions by building a miniature |
8 * element model to represent the contents of the summaries, and then | 8 * element model to represent the contents of the summaries, and then |
9 * scanning the element model to gather linked information and adding | 9 * scanning the element model to gather linked information and adding |
10 * it to the summary data structures. | 10 * it to the summary data structures. |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 @override | 429 @override |
430 PropertyAccessorElement getGetter(String getterName) { | 430 PropertyAccessorElement getGetter(String getterName) { |
431 for (PropertyAccessorElement accessor in accessors) { | 431 for (PropertyAccessorElement accessor in accessors) { |
432 if (accessor.isGetter && accessor.name == getterName) { | 432 if (accessor.isGetter && accessor.name == getterName) { |
433 return accessor; | 433 return accessor; |
434 } | 434 } |
435 } | 435 } |
436 return null; | 436 return null; |
437 } | 437 } |
438 | 438 |
| 439 @override |
| 440 MethodElement getMethod(String methodName) { |
| 441 for (MethodElement method in methods) { |
| 442 if (method.name == methodName) { |
| 443 return method; |
| 444 } |
| 445 } |
| 446 return null; |
| 447 } |
| 448 |
439 /** | 449 /** |
440 * Perform type inference and cycle detection on this class and | 450 * Perform type inference and cycle detection on this class and |
441 * store the resulting information in [compilationUnit]. | 451 * store the resulting information in [compilationUnit]. |
442 */ | 452 */ |
443 void link(CompilationUnitElementInBuildUnit compilationUnit); | 453 void link(CompilationUnitElementInBuildUnit compilationUnit); |
444 | 454 |
445 @override | 455 @override |
446 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 456 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
447 } | 457 } |
448 | 458 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 } else { | 647 } else { |
638 return new InterfaceTypeImpl.elementWithNameAndArgs( | 648 return new InterfaceTypeImpl.elementWithNameAndArgs( |
639 this, name, () => typeArguments); | 649 this, name, () => typeArguments); |
640 } | 650 } |
641 } else { | 651 } else { |
642 return _type ??= new InterfaceTypeImpl(this); | 652 return _type ??= new InterfaceTypeImpl(this); |
643 } | 653 } |
644 } | 654 } |
645 | 655 |
646 @override | 656 @override |
647 MethodElement getMethod(String methodName) { | |
648 for (MethodElement method in methods) { | |
649 if (method.name == methodName) { | |
650 return method; | |
651 } | |
652 } | |
653 return null; | |
654 } | |
655 | |
656 @override | |
657 void link(CompilationUnitElementInBuildUnit compilationUnit) { | 657 void link(CompilationUnitElementInBuildUnit compilationUnit) { |
658 for (ConstructorElementForLink constructorElement in constructors) { | 658 for (ConstructorElementForLink constructorElement in constructors) { |
659 constructorElement.link(compilationUnit); | 659 constructorElement.link(compilationUnit); |
660 } | 660 } |
661 if (library._linker.strongMode) { | 661 if (library._linker.strongMode) { |
662 for (MethodElementForLink methodElement in methods) { | 662 for (MethodElementForLink methodElement in methods) { |
663 methodElement.link(compilationUnit); | 663 methodElement.link(compilationUnit); |
664 } | 664 } |
665 for (PropertyAccessorElementForLink propertyAccessorElement | 665 for (PropertyAccessorElementForLink propertyAccessorElement |
666 in accessors) { | 666 in accessors) { |
(...skipping 4516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5183 * there are no type parameters in scope. | 5183 * there are no type parameters in scope. |
5184 */ | 5184 */ |
5185 TypeParameterizedElementMixin get _typeParameterContext; | 5185 TypeParameterizedElementMixin get _typeParameterContext; |
5186 | 5186 |
5187 @override | 5187 @override |
5188 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 5188 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
5189 | 5189 |
5190 @override | 5190 @override |
5191 String toString() => '$enclosingElement.$name'; | 5191 String toString() => '$enclosingElement.$name'; |
5192 } | 5192 } |
OLD | NEW |