OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver; | 5 library engine.resolver; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import "dart:math" as math; | 8 import "dart:math" as math; |
9 | 9 |
10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
(...skipping 7905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7916 } | 7916 } |
7917 | 7917 |
7918 @override | 7918 @override |
7919 void define(Element element) { | 7919 void define(Element element) { |
7920 if (!Scope.isPrivateName(element.displayName)) { | 7920 if (!Scope.isPrivateName(element.displayName)) { |
7921 super.define(element); | 7921 super.define(element); |
7922 } | 7922 } |
7923 } | 7923 } |
7924 | 7924 |
7925 @override | 7925 @override |
| 7926 Source getSource(AstNode node) { |
| 7927 Source source = super.getSource(node); |
| 7928 if (source == null) { |
| 7929 source = _definingLibrary.definingCompilationUnit.source; |
| 7930 } |
| 7931 return source; |
| 7932 } |
| 7933 |
| 7934 @override |
7926 Element internalLookup(Identifier identifier, String name, LibraryElement refe
rencingLibrary) { | 7935 Element internalLookup(Identifier identifier, String name, LibraryElement refe
rencingLibrary) { |
7927 Element foundElement = localLookup(name, referencingLibrary); | 7936 Element foundElement = localLookup(name, referencingLibrary); |
7928 if (foundElement != null) { | 7937 if (foundElement != null) { |
7929 return foundElement; | 7938 return foundElement; |
7930 } | 7939 } |
7931 for (int i = 0; i < _importedNamespaces.length; i++) { | 7940 for (int i = 0; i < _importedNamespaces.length; i++) { |
7932 Namespace nameSpace = _importedNamespaces[i]; | 7941 Namespace nameSpace = _importedNamespaces[i]; |
7933 Element element = nameSpace.get(name); | 7942 Element element = nameSpace.get(name); |
7934 if (element != null) { | 7943 if (element != null) { |
7935 if (foundElement == null) { | 7944 if (foundElement == null) { |
(...skipping 7557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15493 /** | 15502 /** |
15494 * Return the tag that has the given identifier, or {@code null} if there is n
o such tag (the | 15503 * Return the tag that has the given identifier, or {@code null} if there is n
o such tag (the |
15495 * identifier is not defined). | 15504 * identifier is not defined). |
15496 * | 15505 * |
15497 * @return the tag that has the given identifier | 15506 * @return the tag that has the given identifier |
15498 */ | 15507 */ |
15499 String getTagWithId(String identifier) { | 15508 String getTagWithId(String identifier) { |
15500 return idToTagMap[identifier]; | 15509 return idToTagMap[identifier]; |
15501 } | 15510 } |
15502 } | 15511 } |
OLD | NEW |