Skip to content

Commit 68d1c75

Browse files
author
Dart CI
committed
Version 2.12.0-149.0.dev
Merge commit '4ef857e5d8fcfd9826844ea3ad075dc6fa4a8e5d' into 'dev'
2 parents 5e1f2ce + 4ef857e commit 68d1c75

12 files changed

+237
-244
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class LibraryContext {
5555
AnalysisContextImpl analysisContext;
5656
LinkedElementFactory elementFactory;
5757

58-
Set<LibraryCycle> loadedBundles = Set<LibraryCycle>.identity();
59-
6058
LibraryContext({
6159
@required this.testView,
6260
@required AnalysisSessionImpl session,
@@ -112,7 +110,10 @@ class LibraryContext {
112110
var thisLoadLogBuffer = StringBuffer();
113111

114112
void loadBundle(LibraryCycle cycle, String debugPrefix) {
115-
if (!loadedBundles.add(cycle)) return;
113+
if (cycle.libraries.isEmpty ||
114+
elementFactory.hasLibrary(cycle.libraries.first.uriStr)) {
115+
return;
116+
}
116117

117118
thisLoadLogBuffer.writeln('$debugPrefix$cycle');
118119

@@ -193,9 +194,6 @@ class LibraryContext {
193194
buffer.writeln('[cycle: $cycle]');
194195
buffer.writeln();
195196

196-
buffer.writeln('[loadedBundles: ${loadedBundles.toList()}]');
197-
buffer.writeln();
198-
199197
buffer.writeln('Bundles loaded in this load2() invocation:');
200198
buffer.writeln(thisLoadLogBuffer);
201199
buffer.writeln();

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ class LinkedElementFactory {
381381
return library.exports;
382382
}
383383

384+
bool hasLibrary(String uriStr) {
385+
return libraryReaders[uriStr] != null;
386+
}
387+
384388
bool isLibraryUri(String uriStr) {
385389
var libraryContext = libraryReaders[uriStr];
386390
return !libraryContext.hasPartOfDirective;

pkg/analyzer/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
collection: ^1.10.1
1414
convert: ^2.0.0
1515
crypto: ^2.0.0
16-
glob: ^1.0.3
16+
glob: '>=1.0.3 <3.0.0'
1717
meta: ^1.2.3
1818
package_config: ^1.0.0
1919
path: ^1.0.0

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ void checkElementText(
5757
bool withSyntheticFields = false,
5858
bool withTypes = false,
5959
bool withTypeParameterVariance = false,
60-
bool annotateNullability = false,
6160
}) {
6261
var writer = _ElementWriter(
6362
selfUriStr: '${library.source.uri}',
@@ -70,7 +69,6 @@ void checkElementText(
7069
withSyntheticFields: withSyntheticFields,
7170
withTypes: withTypes,
7271
withTypeParameterVariance: withTypeParameterVariance,
73-
annotateNullability: annotateNullability,
7472
);
7573
writer.writeLibraryElement(library);
7674

@@ -140,7 +138,6 @@ class _ElementWriter {
140138
final bool withSyntheticFields;
141139
final bool withTypes;
142140
final bool withTypeParameterVariance;
143-
final bool annotateNullability;
144141
final StringBuffer buffer = StringBuffer();
145142

146143
String indent = '';
@@ -156,7 +153,6 @@ class _ElementWriter {
156153
this.withSyntheticFields = false,
157154
this.withTypes = false,
158155
this.withTypeParameterVariance,
159-
this.annotateNullability = false,
160156
});
161157

162158
bool isDynamicType(DartType type) => type is DynamicTypeImpl;
@@ -1176,7 +1172,7 @@ class _ElementWriter {
11761172

11771173
String _typeStr(DartType type) {
11781174
return type?.getDisplayString(
1179-
withNullability: annotateNullability,
1175+
withNullability: true,
11801176
);
11811177
}
11821178

@@ -1216,7 +1212,7 @@ class _ElementWriter {
12161212
selfUriStr: selfUriStr,
12171213
sink: buffer,
12181214
indent: indent,
1219-
withNullability: annotateNullability,
1215+
withNullability: true,
12201216
),
12211217
);
12221218
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ResynthesizeAst2Test extends AbstractResynthesizeTest
122122
}
123123

124124
void setUp() {
125-
featureSet = FeatureSets.beforeNullSafe;
125+
featureSet = FeatureSets.nullSafe;
126126
}
127127

128128
void _addLibraryUnits(

0 commit comments

Comments
 (0)