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 analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 5518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5529 */ | 5529 */ |
5530 void set exports(List<ExportElement> exports) { | 5530 void set exports(List<ExportElement> exports) { |
5531 _assertNotResynthesized(_unlinkedDefiningUnit); | 5531 _assertNotResynthesized(_unlinkedDefiningUnit); |
5532 for (ExportElement exportElement in exports) { | 5532 for (ExportElement exportElement in exports) { |
5533 (exportElement as ExportElementImpl).enclosingElement = this; | 5533 (exportElement as ExportElementImpl).enclosingElement = this; |
5534 } | 5534 } |
5535 this._exports = exports; | 5535 this._exports = exports; |
5536 } | 5536 } |
5537 | 5537 |
5538 @override | 5538 @override |
5539 bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI); | 5539 bool get hasExtUri { |
| 5540 if (_unlinkedDefiningUnit != null) { |
| 5541 List<UnlinkedImport> unlinkedImports = _unlinkedDefiningUnit.imports; |
| 5542 for (UnlinkedImport import in unlinkedImports) { |
| 5543 if (DartUriResolver.isDartExtUri(import.uri)) { |
| 5544 return true; |
| 5545 } |
| 5546 } |
| 5547 return false; |
| 5548 } |
| 5549 return hasModifier(Modifier.HAS_EXT_URI); |
| 5550 } |
5540 | 5551 |
5541 /** | 5552 /** |
5542 * Set whether this library has an import of a "dart-ext" URI. | 5553 * Set whether this library has an import of a "dart-ext" URI. |
5543 */ | 5554 */ |
5544 void set hasExtUri(bool hasExtUri) { | 5555 void set hasExtUri(bool hasExtUri) { |
5545 setModifier(Modifier.HAS_EXT_URI, hasExtUri); | 5556 setModifier(Modifier.HAS_EXT_URI, hasExtUri); |
5546 } | 5557 } |
5547 | 5558 |
5548 @override | 5559 @override |
5549 bool get hasLoadLibraryFunction { | 5560 bool get hasLoadLibraryFunction { |
(...skipping 3055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8605 | 8616 |
8606 @override | 8617 @override |
8607 void visitElement(Element element) { | 8618 void visitElement(Element element) { |
8608 int offset = element.nameOffset; | 8619 int offset = element.nameOffset; |
8609 if (offset != -1) { | 8620 if (offset != -1) { |
8610 map[offset] = element; | 8621 map[offset] = element; |
8611 } | 8622 } |
8612 super.visitElement(element); | 8623 super.visitElement(element); |
8613 } | 8624 } |
8614 } | 8625 } |
OLD | NEW |