Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1665353002: Use ElementAnnotation as the ConstantEvaluationTarget for annotations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 // that had too big a performance impact. We could potentially mitigate the 1662 // that had too big a performance impact. We could potentially mitigate the
1663 // impact by computing a more accurate list of the sources containing 1663 // impact by computing a more accurate list of the sources containing
1664 // constructors that are actually referenced, but other approaches should 1664 // constructors that are actually referenced, but other approaches should
1665 // be considered. 1665 // be considered.
1666 // 1666 //
1667 Source librarySource; 1667 Source librarySource;
1668 if (target is Element) { 1668 if (target is Element) {
1669 CompilationUnitElementImpl unit = target 1669 CompilationUnitElementImpl unit = target
1670 .getAncestor((Element element) => element is CompilationUnitElement); 1670 .getAncestor((Element element) => element is CompilationUnitElement);
1671 librarySource = unit.librarySource; 1671 librarySource = unit.librarySource;
1672 } else if (target is ConstantEvaluationTarget_Annotation) { 1672 } else if (target is ElementAnnotationImpl) {
1673 librarySource = target.librarySource; 1673 librarySource = target.librarySource;
1674 } else { 1674 } else {
1675 throw new AnalysisException( 1675 throw new AnalysisException(
1676 'Cannot build inputs for a ${target.runtimeType}'); 1676 'Cannot build inputs for a ${target.runtimeType}');
1677 } 1677 }
1678 return <String, TaskInput>{ 1678 return <String, TaskInput>{
1679 'resolvedUnit': RESOLVED_UNIT10 1679 'resolvedUnit': RESOLVED_UNIT10
1680 .of(new LibrarySpecificUnit(librarySource, target.source)), 1680 .of(new LibrarySpecificUnit(librarySource, target.source)),
1681 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request) 1681 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
1682 }; 1682 };
(...skipping 3549 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 5232
5233 @override 5233 @override
5234 bool moveNext() { 5234 bool moveNext() {
5235 if (_newSources.isEmpty) { 5235 if (_newSources.isEmpty) {
5236 return false; 5236 return false;
5237 } 5237 }
5238 currentTarget = _newSources.removeLast(); 5238 currentTarget = _newSources.removeLast();
5239 return true; 5239 return true;
5240 } 5240 }
5241 } 5241 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/constant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698