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

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

Issue 1744633002: Expose LibraryElementImpl.libraryCycle through LibraryElement. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 // by the task model are conservatively invalidated by the 1932 // by the task model are conservatively invalidated by the
1933 // IMPORT_EXPORT_SOURCE_CLOSURE dependency below. If anything reachable 1933 // IMPORT_EXPORT_SOURCE_CLOSURE dependency below. If anything reachable
1934 // from a node is changed, its LIBRARY_CYCLE results will be re-computed 1934 // from a node is changed, its LIBRARY_CYCLE results will be re-computed
1935 // here (possibly re-using the result from the element model if invalidation 1935 // here (possibly re-using the result from the element model if invalidation
1936 // did not cause it to be erased). In summary, task model dependencies 1936 // did not cause it to be erased). In summary, task model dependencies
1937 // on the import/export source closure ensure that this method will be 1937 // on the import/export source closure ensure that this method will be
1938 // re-run if anything reachable from this target has been invalidated, 1938 // re-run if anything reachable from this target has been invalidated,
1939 // and the invalidation code (invalidateLibraryCycles) will ensure that 1939 // and the invalidation code (invalidateLibraryCycles) will ensure that
1940 // element model results will be re-used here only if they are still valid. 1940 // element model results will be re-used here only if they are still valid.
1941 if (context.analysisOptions.strongMode) { 1941 if (context.analysisOptions.strongMode) {
1942 LibraryElementImpl library = getRequiredInput(LIBRARY_ELEMENT_INPUT); 1942 LibraryElement library = getRequiredInput(LIBRARY_ELEMENT_INPUT);
1943 List<LibraryElement> component = library.libraryCycle; 1943 List<LibraryElement> component = library.libraryCycle;
1944 Set<LibraryElement> filter = new Set<LibraryElement>.from(component); 1944 Set<LibraryElement> filter = new Set<LibraryElement>.from(component);
1945 Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>(); 1945 Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>();
1946 void addLibrary(l) { 1946 void addLibrary(l) {
1947 if (!filter.contains(l)) { 1947 if (!filter.contains(l)) {
1948 deps.addAll(l.units); 1948 deps.addAll(l.units);
1949 } 1949 }
1950 } 1950 }
1951 for (LibraryElement l in component) { 1951 for (LibraryElement l in component) {
1952 l.importedLibraries.forEach(addLibrary); 1952 l.importedLibraries.forEach(addLibrary);
(...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after
5258 5258
5259 @override 5259 @override
5260 bool moveNext() { 5260 bool moveNext() {
5261 if (_newSources.isEmpty) { 5261 if (_newSources.isEmpty) {
5262 return false; 5262 return false;
5263 } 5263 }
5264 currentTarget = _newSources.removeLast(); 5264 currentTarget = _newSources.removeLast();
5265 return true; 5265 return true;
5266 } 5266 }
5267 } 5267 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698