| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 6527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6538 @override | 6538 @override |
| 6539 void set currentValue(Object value) { | 6539 void set currentValue(Object value) { |
| 6540 LibraryElement library = value; | 6540 LibraryElement library = value; |
| 6541 if (_libraries.add(library)) { | 6541 if (_libraries.add(library)) { |
| 6542 if (kind == _SourceClosureKind.IMPORT || | 6542 if (kind == _SourceClosureKind.IMPORT || |
| 6543 kind == _SourceClosureKind.IMPORT_EXPORT) { | 6543 kind == _SourceClosureKind.IMPORT_EXPORT) { |
| 6544 List<ImportElement> imports = library.imports; | 6544 List<ImportElement> imports = library.imports; |
| 6545 int length = imports.length; | 6545 int length = imports.length; |
| 6546 for (int i = 0; i < length; i++) { | 6546 for (int i = 0; i < length; i++) { |
| 6547 ImportElement importElement = imports[i]; | 6547 ImportElement importElement = imports[i]; |
| 6548 Source importedSource = importElement.importedLibrary.source; | 6548 Source importedSource = importElement.importedLibrary?.source; |
| 6549 _newSources.add(importedSource); | 6549 if (importedSource != null) { |
| 6550 _newSources.add(importedSource); |
| 6551 } |
| 6550 } | 6552 } |
| 6551 } | 6553 } |
| 6552 if (kind == _SourceClosureKind.EXPORT || | 6554 if (kind == _SourceClosureKind.EXPORT || |
| 6553 kind == _SourceClosureKind.IMPORT_EXPORT) { | 6555 kind == _SourceClosureKind.IMPORT_EXPORT) { |
| 6554 List<ExportElement> exports = library.exports; | 6556 List<ExportElement> exports = library.exports; |
| 6555 int length = exports.length; | 6557 int length = exports.length; |
| 6556 for (int i = 0; i < length; i++) { | 6558 for (int i = 0; i < length; i++) { |
| 6557 ExportElement exportElement = exports[i]; | 6559 ExportElement exportElement = exports[i]; |
| 6558 Source exportedSource = exportElement.exportedLibrary.source; | 6560 Source exportedSource = exportElement.exportedLibrary?.source; |
| 6559 _newSources.add(exportedSource); | 6561 if (exportedSource != null) { |
| 6562 _newSources.add(exportedSource); |
| 6563 } |
| 6560 } | 6564 } |
| 6561 } | 6565 } |
| 6562 } | 6566 } |
| 6563 } | 6567 } |
| 6564 | 6568 |
| 6565 @override | 6569 @override |
| 6566 bool get flushOnAccess => false; | 6570 bool get flushOnAccess => false; |
| 6567 | 6571 |
| 6568 @override | 6572 @override |
| 6569 List<Source> get inputValue { | 6573 List<Source> get inputValue { |
| 6570 return _libraries.map((LibraryElement library) => library.source).toList(); | 6574 return _libraries.map((LibraryElement library) => library.source).toList(); |
| 6571 } | 6575 } |
| 6572 | 6576 |
| 6573 @override | 6577 @override |
| 6574 void currentValueNotAvailable() { | 6578 void currentValueNotAvailable() { |
| 6575 // Nothing needs to be done. moveNext() will simply go on to the next new | 6579 // Nothing needs to be done. moveNext() will simply go on to the next new |
| 6576 // source. | 6580 // source. |
| 6577 } | 6581 } |
| 6578 | 6582 |
| 6579 @override | 6583 @override |
| 6580 bool moveNext() { | 6584 bool moveNext() { |
| 6581 if (_newSources.isEmpty) { | 6585 if (_newSources.isEmpty) { |
| 6582 return false; | 6586 return false; |
| 6583 } | 6587 } |
| 6584 currentTarget = _newSources.removeLast(); | 6588 currentTarget = _newSources.removeLast(); |
| 6585 return true; | 6589 return true; |
| 6586 } | 6590 } |
| 6587 } | 6591 } |
| OLD | NEW |