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

Side by Side Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1841853002: Fix summary detection of cycles via redirect/super arguments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/summary/summary_common.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 ConstructorElementForLink constructor = constructorElement 643 ConstructorElementForLink constructor = constructorElement
644 .enclosingElement 644 .enclosingElement
645 .getContainedName(constructorInitializer.name) 645 .getContainedName(constructorInitializer.name)
646 .asConstructor; 646 .asConstructor;
647 safeAddDependency(constructor?._constNode); 647 safeAddDependency(constructor?._constNode);
648 } 648 }
649 CompilationUnitElementForLink compilationUnit = 649 CompilationUnitElementForLink compilationUnit =
650 constructorElement.enclosingElement.enclosingElement; 650 constructorElement.enclosingElement.enclosingElement;
651 collectDependencies( 651 collectDependencies(
652 dependencies, constructorInitializer.expression, compilationUnit); 652 dependencies, constructorInitializer.expression, compilationUnit);
653 constructorInitializer.arguments.map((UnlinkedConst unlinkedConst) => 653 for (UnlinkedConst unlinkedConst in constructorInitializer.arguments) {
654 collectDependencies(dependencies, unlinkedConst, compilationUnit)); 654 collectDependencies(dependencies, unlinkedConst, compilationUnit);
655 }
655 } 656 }
656 657
657 if (defaultSuperInvocationNeeded) { 658 if (defaultSuperInvocationNeeded) {
658 // No explicit superconstructor invocation found, so we need to 659 // No explicit superconstructor invocation found, so we need to
659 // manually insert a reference to the implicit superconstructor. 660 // manually insert a reference to the implicit superconstructor.
660 if (superClass != null && !superClass.isObject) { 661 if (superClass != null && !superClass.isObject) {
661 ConstructorElementForLink unnamedConstructor = 662 ConstructorElementForLink unnamedConstructor =
662 superClass.unnamedConstructor; 663 superClass.unnamedConstructor;
663 safeAddDependency(unnamedConstructor?._constNode); 664 safeAddDependency(unnamedConstructor?._constNode);
664 } 665 }
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 1603
1603 /** 1604 /**
1604 * Throw away any information produced by a previous call to [link]. 1605 * Throw away any information produced by a previous call to [link].
1605 */ 1606 */
1606 void unlink() { 1607 void unlink() {
1607 for (LibraryElementInBuildUnit library in _librariesInBuildUnit) { 1608 for (LibraryElementInBuildUnit library in _librariesInBuildUnit) {
1608 library.unlink(); 1609 library.unlink();
1609 } 1610 }
1610 } 1611 }
1611 } 1612 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698