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

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

Issue 1810393002: Fix unguarded cast to an impl class (issue 26035) (Closed) Base URL: https://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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3585 // cycle information for all nodes that are between the target and the 3585 // cycle information for all nodes that are between the target and the
3586 // node in the topological order. For simplicity, we simply invalidate 3586 // node in the topological order. For simplicity, we simply invalidate
3587 // all nodes which are reachable from the the source node. 3587 // all nodes which are reachable from the the source node.
3588 // Note that in the invalidation phase, we do not cut off when we encounter 3588 // Note that in the invalidation phase, we do not cut off when we encounter
3589 // a node with no library cycle information, since we do not know whether 3589 // a node with no library cycle information, since we do not know whether
3590 // we are in the case where invalidation has already been performed, or we 3590 // we are in the case where invalidation has already been performed, or we
3591 // are in the case where library cycles have simply never been computed from 3591 // are in the case where library cycles have simply never been computed from
3592 // a newly reachable node. 3592 // a newly reachable node.
3593 Set<LibraryElementImpl> active = new HashSet(); 3593 Set<LibraryElementImpl> active = new HashSet();
3594 void invalidate(LibraryElement library) { 3594 void invalidate(LibraryElement library) {
3595 if (library is LibraryElementHandle) {
3596 library = (library as LibraryElementHandle).actualElement;
3597 }
3595 LibraryElementImpl libraryImpl = library; 3598 LibraryElementImpl libraryImpl = library;
3596 if (active.add(libraryImpl)) { 3599 if (active.add(libraryImpl)) {
3597 if (libraryImpl._libraryCycle != null) { 3600 if (libraryImpl._libraryCycle != null) {
3598 libraryImpl._libraryCycle.forEach(invalidate); 3601 libraryImpl._libraryCycle.forEach(invalidate);
3599 libraryImpl._libraryCycle = null; 3602 libraryImpl._libraryCycle = null;
3600 } 3603 }
3601 library.exportedLibraries.forEach(invalidate); 3604 library.exportedLibraries.forEach(invalidate);
3602 library.importedLibraries.forEach(invalidate); 3605 library.importedLibraries.forEach(invalidate);
3603 } 3606 }
3604 } 3607 }
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
4924 4927
4925 @override 4928 @override
4926 void visitElement(Element element) { 4929 void visitElement(Element element) {
4927 int offset = element.nameOffset; 4930 int offset = element.nameOffset;
4928 if (offset != -1) { 4931 if (offset != -1) {
4929 map[offset] = element; 4932 map[offset] = element;
4930 } 4933 }
4931 super.visitElement(element); 4934 super.visitElement(element);
4932 } 4935 }
4933 } 4936 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698