Skip to content

Commit aa0fea7

Browse files
author
Dart CI
committed
Version 2.13.0-81.0.dev
Merge commit '8c7e873f8f1a8ec83095732f4afab3bda444fb71' into 'dev'
2 parents b162183 + 8c7e873 commit aa0fea7

File tree

98 files changed

+1088
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1088
-601
lines changed

.dart_tool/package_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2021-02-24T07:33:35.310314",
14+
"generated": "2021-02-25T12:53:17.111860",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -327,7 +327,7 @@
327327
"name": "http_multi_server",
328328
"rootUri": "../third_party/pkg/http_multi_server",
329329
"packageUri": "lib/",
330-
"languageVersion": "2.1"
330+
"languageVersion": "2.12"
331331
},
332332
{
333333
"name": "http_parser",

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ vars = {
108108
"glob_rev": "a62acf590598f458d3198d9f2930c1c9dd4b1379",
109109
"html_rev": "00cd3c22dac0e68e6ed9e7e4945101aedb1b3109",
110110
"http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b",
111-
"http_multi_server_rev" : "e8c8be7f15b4fb50757ff5bf29766721fbe24fe4",
111+
"http_multi_server_rev" : "6bf4b6e5d4d890e6d54559b858ff229d79711171",
112112
"http_parser_rev": "5dd4d16693242049dfb43b5efa429fedbf932e98",
113113
"http_retry_tag": "0.1.1",
114114
"http_rev": "d5c678cd63c3e9c1d779a09acfa95b7e3af84665",
@@ -168,7 +168,7 @@ vars = {
168168
"web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
169169
"web_socket_channel_rev": "76931ea1b81ba71e8319330c35285d3e88566315",
170170
"WebCore_rev": "fb11e887f77919450e497344da570d780e078bc8",
171-
"yaml_rev": "2392d113b0104dd19358f2833a282f19e2d67c01",
171+
"yaml_rev": "b4c4411631bda556ce9a45af1ab0eecaf9f3ac53",
172172
"zlib_rev": "bf44340d1b6be1af8950bbdf664fec0cf5a831cc",
173173
"crashpad_rev": "bf327d8ceb6a669607b0dbab5a83a275d03f99ed",
174174
"minichromium_rev": "8d641e30a8b12088649606b912c2bc4947419ccc",

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,8 @@ abstract class NonPromotionReasonVisitor<R, Node extends Object,
23882388
DemoteViaForEachVariableWrite<Variable, Node> reason);
23892389

23902390
R visitPropertyNotPromoted(PropertyNotPromoted reason);
2391+
2392+
R visitThisNotPromoted(ThisNotPromoted reason);
23912393
}
23922394

23932395
/// Non-promotion reason describing the situation where an expression was not
@@ -2622,6 +2624,19 @@ class SsaNode<Variable extends Object, Type extends Object> {
26222624
}
26232625
}
26242626

2627+
/// Non-promotion reason describing the situation where an expression was not
2628+
/// promoted due to the fact that it's a reference to `this`.
2629+
class ThisNotPromoted extends NonPromotionReason {
2630+
@override
2631+
String get shortName => 'thisNotPromoted';
2632+
2633+
@override
2634+
R accept<R, Node extends Object, Expression extends Object,
2635+
Variable extends Object>(
2636+
NonPromotionReasonVisitor<R, Node, Expression, Variable> visitor) =>
2637+
visitor.visitThisNotPromoted(this);
2638+
}
2639+
26252640
/// Enum representing the different classifications of types that can be
26262641
/// returned by [TypeOperations.classifyType].
26272642
enum TypeClassification {
@@ -5099,8 +5114,14 @@ class _ThisReference<Variable extends Object, Type extends Object>
50995114
Map<Type, NonPromotionReason> getNonPromotionReasons(
51005115
Map<Variable?, VariableModel<Variable, Type>> variableInfo,
51015116
TypeOperations<Variable, Type> typeOperations) {
5102-
// TODO(paulberry): implement.
5103-
return {};
5117+
Map<Type, NonPromotionReason> result = <Type, NonPromotionReason>{};
5118+
List<Type>? promotedTypes = _getInfo(variableInfo)?.promotedTypes;
5119+
if (promotedTypes != null) {
5120+
for (Type type in promotedTypes) {
5121+
result[type] = new ThisNotPromoted();
5122+
}
5123+
}
5124+
return result;
51045125
}
51055126

51065127
@override

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8927,6 +8927,13 @@ const MessageCode messageThisInNullAwareReceiver = const MessageCode(
89278927
message: r"""The receiver 'this' cannot be null.""",
89288928
tip: r"""Try replacing '?.' with '.'""");
89298929

8930+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
8931+
const Code<Null> codeThisNotPromoted = messageThisNotPromoted;
8932+
8933+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
8934+
const MessageCode messageThisNotPromoted = const MessageCode("ThisNotPromoted",
8935+
message: r"""'this' can't be promoted.""");
8936+
89308937
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
89318938
const Template<Message Function(String string)>
89328939
templateThisOrSuperAccessInFieldInitializer =

pkg/_fe_analyzer_shared/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: _fe_analyzer_shared
2-
version: 16.0.0
2+
version: 17.0.0
33
description: Logic that is shared between the front_end and analyzer packages.
44
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/_fe_analyzer_shared
55

pkg/analysis_server/lib/src/analysis_server_abstract.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,13 @@ abstract class AbstractAnalysisServer {
234234
if (drivers.isNotEmpty) {
235235
// Sort the drivers so that more deeply nested contexts will be checked
236236
// before enclosing contexts.
237-
drivers.sort((first, second) =>
238-
second.contextRoot.root.length - first.contextRoot.root.length);
237+
drivers.sort((first, second) {
238+
var firstRoot = first.analysisContext.contextRoot.root.path;
239+
var secondRoot = second.analysisContext.contextRoot.root.path;
240+
return secondRoot.length - firstRoot.length;
241+
});
239242
var driver = drivers.firstWhere(
240-
(driver) => driver.contextRoot.containsFile(path),
243+
(driver) => driver.analysisContext.contextRoot.isAnalyzed(path),
241244
orElse: () => null);
242245
driver ??= drivers.firstWhere(
243246
(driver) => driver.knownFiles.contains(path),

pkg/analysis_server/lib/src/domain_analysis.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ class AnalysisDomainHandler extends AbstractRequestHandler {
156156
//
157157
var requestParams =
158158
plugin.AnalysisGetNavigationParams(file, offset, length);
159-
var pluginFutures = server.pluginManager
160-
.broadcastRequest(requestParams, contextRoot: driver.contextRoot);
159+
var pluginFutures = server.pluginManager.broadcastRequest(
160+
requestParams,
161+
contextRoot: driver.analysisContext.contextRoot,
162+
);
161163
//
162164
// Compute navigation data generated by server.
163165
//

pkg/analysis_server/lib/src/domain_completion.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ class CompletionDomainHandler extends AbstractRequestHandler {
8484
var driver = server.getAnalysisDriver(file);
8585
if (driver != null) {
8686
requestParams = plugin.CompletionGetSuggestionsParams(file, offset);
87-
pluginFutures = server.pluginManager
88-
.broadcastRequest(requestParams, contextRoot: driver.contextRoot);
87+
pluginFutures = server.pluginManager.broadcastRequest(
88+
requestParams,
89+
contextRoot: driver.analysisContext.contextRoot,
90+
);
8991
}
9092
//
9193
// Compute completions generated by server.

pkg/analysis_server/lib/src/domain_kythe.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ class KytheDomainHandler extends AbstractRequestHandler {
3434
// Allow plugins to start computing entries.
3535
//
3636
var requestParams = plugin.KytheGetKytheEntriesParams(file);
37-
var pluginFutures = server.pluginManager
38-
.broadcastRequest(requestParams, contextRoot: driver.contextRoot);
37+
var pluginFutures = server.pluginManager.broadcastRequest(
38+
requestParams,
39+
contextRoot: driver.analysisContext.contextRoot,
40+
);
3941
//
4042
// Compute entries generated by server.
4143
//

pkg/analysis_server/lib/src/edit/edit_domain.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ class EditDomainHandler extends AbstractRequestHandler {
215215
if (driver == null) {
216216
pluginFutures = <PluginInfo, Future<plugin.Response>>{};
217217
} else {
218-
pluginFutures = server.pluginManager
219-
.broadcastRequest(requestParams, contextRoot: driver.contextRoot);
218+
pluginFutures = server.pluginManager.broadcastRequest(
219+
requestParams,
220+
contextRoot: driver.analysisContext.contextRoot,
221+
);
220222
}
221223

222224
//
@@ -273,8 +275,10 @@ class EditDomainHandler extends AbstractRequestHandler {
273275
if (driver == null) {
274276
pluginFutures = <PluginInfo, Future<plugin.Response>>{};
275277
} else {
276-
pluginFutures = server.pluginManager
277-
.broadcastRequest(requestParams, contextRoot: driver.contextRoot);
278+
pluginFutures = server.pluginManager.broadcastRequest(
279+
requestParams,
280+
contextRoot: driver.analysisContext.contextRoot,
281+
);
278282
}
279283
//
280284
// Compute fixes associated with server-generated errors.

0 commit comments

Comments
 (0)