Skip to content

Commit 34c8898

Browse files
scheglovCommit Bot
authored andcommitted
Rename link2() to link(), deprecate link2().
Change-Id: Ib1709af2f01e8f0231891ff9790d0c33bf5d27b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240503 Reviewed-by: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent 44c1a24 commit 34c8898

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

pkg/analyzer/lib/dart/sdk/build_sdk_summary.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class _Builder {
106106
Reference.root(),
107107
);
108108

109-
var linkResult = await link2(elementFactory, inputLibraries);
109+
var linkResult = await link(elementFactory, inputLibraries);
110110

111111
var bundleBuilder = PackageBundleBuilder();
112112
for (var library in inputLibraries) {

pkg/analyzer/lib/src/dart/analysis/library_context.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ class LibraryContext {
206206
link2.LinkResult linkResult;
207207
try {
208208
timerLinking.start();
209-
// TODO(scheglov) Migrate when we are ready to switch to async.
210-
// ignore: deprecated_member_use_from_same_package
211-
linkResult = await link2.link2(elementFactory, inputLibraries);
209+
linkResult = await link2.link(elementFactory, inputLibraries);
212210
librariesLinked += cycle.libraries.length;
213211
counterLinkedLibraries += inputLibraries.length;
214212
timerLinking.stop();

pkg/analyzer/lib/src/dart/micro/resolve_file.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ class _LibraryContext {
889889
}
890890
inputsTimer.stop();
891891

892-
var linkResult = await link2.link2(elementFactory, inputLibraries);
892+
var linkResult = await link2.link(elementFactory, inputLibraries);
893893
librariesLinked += cycle.libraries.length;
894894

895895
resolutionBytes = linkResult.resolutionBytes;

pkg/analyzer/lib/src/summary2/link.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import 'package:analyzer/src/summary2/variance_builder.dart';
2626
var timerLinkingLinkingBundle = Stopwatch();
2727

2828
/// Note that AST units and tokens of [inputLibraries] will be damaged.
29-
Future<LinkResult> link2(
29+
Future<LinkResult> link(
3030
LinkedElementFactory elementFactory,
3131
List<LinkInputLibrary> inputLibraries,
3232
) async {
@@ -37,6 +37,15 @@ Future<LinkResult> link2(
3737
);
3838
}
3939

40+
/// Note that AST units and tokens of [inputLibraries] will be damaged.
41+
@Deprecated('Use link() instead')
42+
Future<LinkResult> link2(
43+
LinkedElementFactory elementFactory,
44+
List<LinkInputLibrary> inputLibraries,
45+
) async {
46+
return link(elementFactory, inputLibraries);
47+
}
48+
4049
class Linker {
4150
final LinkedElementFactory elementFactory;
4251

pkg/analyzer/test/src/summary/elements_base.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ abstract class ElementsBaseTest with ResourceProviderMixin {
102102
Reference.root(),
103103
);
104104

105-
var sdkLinkResult = await link2(elementFactory, inputLibraries);
105+
var sdkLinkResult = await link(elementFactory, inputLibraries);
106106

107107
return _sdkBundle = _SdkBundle(
108108
resolutionBytes: sdkLinkResult.resolutionBytes,
@@ -160,7 +160,7 @@ abstract class ElementsBaseTest with ResourceProviderMixin {
160160
),
161161
);
162162

163-
var linkResult = await link2(elementFactory, inputLibraries);
163+
var linkResult = await link(elementFactory, inputLibraries);
164164

165165
if (!keepLinkingLibraries) {
166166
elementFactory.removeBundle(

0 commit comments

Comments
 (0)