Chromium Code Reviews| 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/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1817 // all of the constructor initializers that we might encounter have been | 1817 // all of the constructor initializers that we might encounter have been |
| 1818 // copied into the element model. We tried forcing the computation of the | 1818 // copied into the element model. We tried forcing the computation of the |
| 1819 // RESOLVED_UNIT9 for each unit reachable from the target's library, but | 1819 // RESOLVED_UNIT9 for each unit reachable from the target's library, but |
| 1820 // that had too big a performance impact. We could potentially mitigate the | 1820 // that had too big a performance impact. We could potentially mitigate the |
| 1821 // impact by computing a more accurate list of the sources containing | 1821 // impact by computing a more accurate list of the sources containing |
| 1822 // constructors that are actually referenced, but other approaches should | 1822 // constructors that are actually referenced, but other approaches should |
| 1823 // be considered. | 1823 // be considered. |
| 1824 // | 1824 // |
| 1825 Source librarySource; | 1825 Source librarySource; |
| 1826 if (target is Element) { | 1826 if (target is Element) { |
| 1827 CompilationUnitElementImpl unit = target | 1827 Element elt = target as Element; |
|
Brian Wilkerson
2016/02/01 15:43:20
This shouldn't be necessary because of type propag
| |
| 1828 CompilationUnitElementImpl unit = elt | |
| 1828 .getAncestor((Element element) => element is CompilationUnitElement); | 1829 .getAncestor((Element element) => element is CompilationUnitElement); |
| 1829 librarySource = unit.librarySource; | 1830 librarySource = unit.librarySource; |
| 1830 } else if (target is ConstantEvaluationTarget_Annotation) { | 1831 } else if (target is ConstantEvaluationTarget_Annotation) { |
| 1831 librarySource = target.librarySource; | 1832 librarySource = target.librarySource; |
| 1832 } else { | 1833 } else { |
| 1833 throw new AnalysisException( | 1834 throw new AnalysisException( |
| 1834 'Cannot build inputs for a ${target.runtimeType}'); | 1835 'Cannot build inputs for a ${target.runtimeType}'); |
| 1835 } | 1836 } |
| 1836 return <String, TaskInput>{ | 1837 return <String, TaskInput>{ |
| 1837 'resolvedUnit': RESOLVED_UNIT10 | 1838 'resolvedUnit': RESOLVED_UNIT10 |
| (...skipping 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5478 | 5479 |
| 5479 @override | 5480 @override |
| 5480 bool moveNext() { | 5481 bool moveNext() { |
| 5481 if (_newSources.isEmpty) { | 5482 if (_newSources.isEmpty) { |
| 5482 return false; | 5483 return false; |
| 5483 } | 5484 } |
| 5484 currentTarget = _newSources.removeLast(); | 5485 currentTarget = _newSources.removeLast(); |
| 5485 return true; | 5486 return true; |
| 5486 } | 5487 } |
| 5487 } | 5488 } |
| OLD | NEW |