| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import 'dart:uri'; | 7 import 'dart:uri'; |
| 8 import 'dart:collection' show LinkedHashMap; | 8 import 'dart:collection' show LinkedHashMap; |
| 9 | 9 |
| 10 import 'elements.dart'; | 10 import 'elements.dart'; |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 * Find the first member in the class chain with the given [selector]. | 1515 * Find the first member in the class chain with the given [selector]. |
| 1516 * | 1516 * |
| 1517 * This method is NOT to be used for resolving | 1517 * This method is NOT to be used for resolving |
| 1518 * unqualified sends because it does not implement the scoping | 1518 * unqualified sends because it does not implement the scoping |
| 1519 * rules, where library scope comes before superclass scope. | 1519 * rules, where library scope comes before superclass scope. |
| 1520 * | 1520 * |
| 1521 * When called on the implementation element both members declared in the | 1521 * When called on the implementation element both members declared in the |
| 1522 * origin and the patch class are returned. | 1522 * origin and the patch class are returned. |
| 1523 */ | 1523 */ |
| 1524 Element lookupSelector(Selector selector) { | 1524 Element lookupSelector(Selector selector) { |
| 1525 return internalLookupSelector(selector, false); |
| 1526 } |
| 1527 |
| 1528 Element lookupSuperSelector(Selector selector) { |
| 1529 return internalLookupSelector(selector, true); |
| 1530 } |
| 1531 |
| 1532 Element internalLookupSelector(Selector selector, bool isSuperLookup) { |
| 1525 SourceString name = selector.name; | 1533 SourceString name = selector.name; |
| 1526 bool isPrivate = name.isPrivate(); | 1534 bool isPrivate = name.isPrivate(); |
| 1527 LibraryElement library = selector.library; | 1535 LibraryElement library = selector.library; |
| 1528 for (ClassElement current = this; | 1536 for (ClassElement current = isSuperLookup ? superclass : this; |
| 1529 current != null; | 1537 current != null; |
| 1530 current = current.superclass) { | 1538 current = current.superclass) { |
| 1531 Element member = current.lookupLocalMember(name); | 1539 Element member = current.lookupLocalMember(name); |
| 1532 if (member == null) continue; | 1540 if (member == null) continue; |
| 1533 // Private members from a different library are not visible. | 1541 // Private members from a different library are not visible. |
| 1534 if (isPrivate && !identical(library, member.getLibrary())) continue; | 1542 if (isPrivate && !identical(library, member.getLibrary())) continue; |
| 1535 // Static members are not inherited. | 1543 // Static members are not inherited. |
| 1536 if (member.modifiers.isStatic() && !identical(this, current)) continue; | 1544 if (member.modifiers.isStatic() && !identical(this, current)) continue; |
| 1537 // If we find an abstract field we have to make sure that it has | 1545 // If we find an abstract field we have to make sure that it has |
| 1538 // the getter or setter part we're actually looking | 1546 // the getter or setter part we're actually looking |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 | 2016 |
| 2009 MetadataAnnotation ensureResolved(Compiler compiler) { | 2017 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2010 if (resolutionState == STATE_NOT_STARTED) { | 2018 if (resolutionState == STATE_NOT_STARTED) { |
| 2011 compiler.resolver.resolveMetadataAnnotation(this); | 2019 compiler.resolver.resolveMetadataAnnotation(this); |
| 2012 } | 2020 } |
| 2013 return this; | 2021 return this; |
| 2014 } | 2022 } |
| 2015 | 2023 |
| 2016 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2024 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2017 } | 2025 } |
| OLD | NEW |