Chromium Code Reviews| Index: pkg/analyzer/lib/src/dart/element/element.dart |
| diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
| index d465b405556fad6a281fb6302d3840935c2c43ba..111475c2ce283a605aac7a96028452021a978a24 100644 |
| --- a/pkg/analyzer/lib/src/dart/element/element.dart |
| +++ b/pkg/analyzer/lib/src/dart/element/element.dart |
| @@ -4035,8 +4035,7 @@ class ExportElementImpl extends UriReferencedElementImpl |
| LibraryElement get exportedLibrary { |
| if (_unlinkedExportNonPublic != null && _exportedLibrary == null) { |
| LibraryElementImpl library = enclosingElement as LibraryElementImpl; |
| - _exportedLibrary = library.resynthesizerContext |
| - .buildExportedLibrary(_unlinkedExportPublic.uri); |
| + _exportedLibrary = library.resynthesizerContext.buildExportedLibrary(uri); |
| } |
| return _exportedLibrary; |
| } |
| @@ -4078,7 +4077,8 @@ class ExportElementImpl extends UriReferencedElementImpl |
| @override |
| String get uri { |
| if (_unlinkedExportPublic != null) { |
| - return _unlinkedExportPublic.uri; |
| + return _selectUri( |
|
Paul Berry
2016/09/18 13:46:49
For efficiency we should cache this result in a lo
scheglov
2016/09/18 21:03:48
Done.
|
| + _unlinkedExportPublic.uri, _unlinkedExportPublic.configurations); |
| } |
| return super.uri; |
| } |
| @@ -5006,7 +5006,7 @@ class ImportElementImpl extends UriReferencedElementImpl |
| if (_unlinkedImport.isImplicit) { |
| return null; |
| } |
| - return _unlinkedImport.uri; |
| + return _selectUri(_unlinkedImport.uri, _unlinkedImport.configurations); |
|
Paul Berry
2016/09/18 13:46:49
Same here.
scheglov
2016/09/18 21:03:48
Done.
|
| } |
| return super.uri; |
| } |
| @@ -8202,6 +8202,17 @@ abstract class UriReferencedElementImpl extends ElementImpl |
| void set uriOffset(int offset) { |
| _uriOffset = offset; |
| } |
| + |
| + String _selectUri( |
| + String defaultUri, List<UnlinkedConfiguration> configurations) { |
| + for (UnlinkedConfiguration configuration in configurations) { |
| + if (context.declaredVariables.get(configuration.name) == |
| + configuration.value) { |
| + return configuration.uri; |
| + } |
| + } |
| + return defaultUri; |
| + } |
| } |
| /** |