Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit cfaa760

Browse files
author
Dart CI
committed
Version 2.12.0-106.0.dev
Merge commit '1bfcc2d8da7a5a5f8f5a41dcb346ea1ddbd4191d' into 'dev'
2 parents fc37631 + 1bfcc2d commit cfaa760

File tree

157 files changed

+20186
-33452
lines changed

Some content is hidden

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

157 files changed

+20186
-33452
lines changed

.dart_tool/package_config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2020-11-15T14:18:10.587065",
14+
"generated": "2020-11-30T16:23:50.740805",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
1818
"name": "_fe_analyzer_shared",
1919
"rootUri": "../pkg/_fe_analyzer_shared",
2020
"packageUri": "lib/",
21-
"languageVersion": "2.2"
21+
"languageVersion": "2.6"
2222
},
2323
{
2424
"name": "_fe_analyzer_shared_assigned_variables",
@@ -101,7 +101,7 @@
101101
"name": "args",
102102
"rootUri": "../third_party/pkg/args",
103103
"packageUri": "lib/",
104-
"languageVersion": "2.3"
104+
"languageVersion": "2.12"
105105
},
106106
{
107107
"name": "async",

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ opted out of null safety by adding `// @dart=2.9` to the beginning of the file.
2525
constructors, a name which can be associated with the port and displayed in
2626
tooling.
2727

28+
#### `dart:collection`
29+
30+
* `LinkedList` made it explicit that elements are compared by identity,
31+
and updated `contains` to take advantage of this.
32+
2833
### Dart VM
2934

3035
* **Breaking Change** [#42312][]: `Dart_WeakPersistentHandle`s will no longer

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ vars = {
6868
"gperftools_revision": "180bfa10d7cb38e8b3784d60943d50e8fcef0dcb",
6969

7070
# Revisions of /third_party/* dependencies.
71-
"args_tag": "1.6.0",
71+
"args_rev": "139140125126661fac88c9aa5882165936d01c91",
7272
"async_rev": "695b3ac280f107c84adf7488743abfdfaaeea68f",
7373
"bazel_worker_rev": "060c55a933d39798681a4f533b161b81dc48d77e",
7474
"benchmark_harness_rev": "ec6b646f5443faa871e126ac1ba248c94ca06257",
@@ -301,7 +301,7 @@ deps = {
301301
"@" + Var("gperftools_revision"),
302302

303303
Var("dart_root") + "/third_party/pkg/args":
304-
Var("dart_git") + "args.git" + "@" + Var("args_tag"),
304+
Var("dart_git") + "args.git" + "@" + Var("args_rev"),
305305
Var("dart_root") + "/third_party/pkg/async":
306306
Var("dart_git") + "async.git" + "@" + Var("async_rev"),
307307
Var("dart_root") + "/third_party/pkg/bazel_worker":

pkg/_fe_analyzer_shared/lib/src/base/errors.dart

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ abstract class ErrorCode {
1616
*/
1717
final String name;
1818

19+
/**
20+
* The unique name of this error code.
21+
*/
22+
final String uniqueName;
23+
1924
final String _message;
2025

2126
final String _correction;
@@ -37,34 +42,34 @@ abstract class ErrorCode {
3742
* template. The correction associated with the error will be created from the
3843
* given [correction] template.
3944
*/
40-
const ErrorCode(this.name, String message,
41-
[String correction, this.hasPublishedDocs = false])
42-
: isUnresolvedIdentifier = false,
45+
const ErrorCode({
46+
String correction,
47+
this.hasPublishedDocs = false,
48+
this.isUnresolvedIdentifier: false,
49+
@required String message,
50+
@required this.name,
51+
@required this.uniqueName,
52+
}) : _correction = correction,
4353
_message = message,
44-
_correction = correction;
45-
46-
/**
47-
* Initialize a newly created error code to have the given [name]. The message
48-
* associated with the error will be created from the given [message]
49-
* template. The correction associated with the error will be created from the
50-
* given [correction] template.
51-
*/
52-
const ErrorCode.temporary(this.name, String message,
53-
{String correction,
54-
this.isUnresolvedIdentifier = false,
55-
this.hasPublishedDocs = false})
56-
: _message = message,
57-
_correction = correction;
54+
assert(hasPublishedDocs != null),
55+
assert(isUnresolvedIdentifier != null);
5856

57+
@Deprecated('Use the default constructor')
5958
const ErrorCode.temporary2({
6059
String correction,
61-
this.hasPublishedDocs = false,
62-
this.isUnresolvedIdentifier = false,
60+
bool hasPublishedDocs = false,
61+
bool isUnresolvedIdentifier = false,
6362
@required String message,
64-
@required this.name,
63+
@required String name,
6564
@required String uniqueName,
66-
}) : _correction = correction,
67-
_message = message;
65+
}) : this(
66+
correction: correction,
67+
hasPublishedDocs: hasPublishedDocs,
68+
isUnresolvedIdentifier: isUnresolvedIdentifier,
69+
message: message,
70+
name: name,
71+
uniqueName: uniqueName,
72+
);
6873

6974
/**
7075
* The template used to create the correction to be displayed for this error,
@@ -93,11 +98,6 @@ abstract class ErrorCode {
9398
*/
9499
ErrorType get type;
95100

96-
/**
97-
* The unique name of this error code.
98-
*/
99-
String get uniqueName => "$runtimeType.$name";
100-
101101
/**
102102
* Return a URL that can be used to access documentation for diagnostics with
103103
* this code, or `null` if there is no published documentation.

pkg/_fe_analyzer_shared/lib/src/scanner/errors.dart

Lines changed: 92 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,8 @@
55
import '../base/errors.dart';
66
import '../messages/codes.dart';
77
import 'error_token.dart';
8-
import 'token_constants.dart';
98
import 'token.dart' show Token, TokenType;
10-
11-
/**
12-
* The error codes used for errors detected by the scanner.
13-
*/
14-
class ScannerErrorCode extends ErrorCode {
15-
/**
16-
* Parameters:
17-
* 0: the token that was expected but not found
18-
*/
19-
static const ScannerErrorCode EXPECTED_TOKEN =
20-
const ScannerErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'.");
21-
22-
/**
23-
* Parameters:
24-
* 0: the illegal character
25-
*/
26-
static const ScannerErrorCode ILLEGAL_CHARACTER =
27-
const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character '{0}'.");
28-
29-
static const ScannerErrorCode MISSING_DIGIT =
30-
const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected.");
31-
32-
static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode(
33-
'MISSING_HEX_DIGIT', "Hexadecimal digit expected.");
34-
35-
static const ScannerErrorCode MISSING_IDENTIFIER =
36-
const ScannerErrorCode('MISSING_IDENTIFIER', "Expected an identifier.");
37-
38-
static const ScannerErrorCode MISSING_QUOTE =
39-
const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \").");
40-
41-
/**
42-
* Parameters:
43-
* 0: the path of the file that cannot be read
44-
*/
45-
static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode(
46-
'UNABLE_GET_CONTENT', "Unable to get content of '{0}'.");
47-
48-
static const ScannerErrorCode UNEXPECTED_DOLLAR_IN_STRING =
49-
const ScannerErrorCode(
50-
'UNEXPECTED_DOLLAR_IN_STRING',
51-
"A '\$' has special meaning inside a string, and must be followed by "
52-
"an identifier or an expression in curly braces ({}).",
53-
correction: "Try adding a backslash (\\) to escape the '\$'.");
54-
55-
/**
56-
* Parameters:
57-
* 0: the unsupported operator
58-
*/
59-
static const ScannerErrorCode UNSUPPORTED_OPERATOR = const ScannerErrorCode(
60-
'UNSUPPORTED_OPERATOR', "The '{0}' operator is not supported.");
61-
62-
static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
63-
const ScannerErrorCode(
64-
'UNTERMINATED_MULTI_LINE_COMMENT', "Unterminated multi-line comment.",
65-
correction: "Try terminating the comment with '*/', or "
66-
"removing any unbalanced occurrences of '/*'"
67-
" (because comments nest in Dart).");
68-
69-
static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
70-
const ScannerErrorCode(
71-
'UNTERMINATED_STRING_LITERAL', "Unterminated string literal.");
72-
73-
/**
74-
* Initialize a newly created error code to have the given [name]. The message
75-
* associated with the error will be created from the given [message]
76-
* template. The correction associated with the error will be created from the
77-
* given [correction] template.
78-
*/
79-
const ScannerErrorCode(String name, String message, {String correction})
80-
: super.temporary(name, message, correction: correction);
81-
82-
@override
83-
ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
84-
85-
@override
86-
ErrorType get type => ErrorType.SYNTACTIC_ERROR;
87-
}
88-
89-
/**
90-
* Used to report a scan error at the given offset.
91-
* The [errorCode] is the error code indicating the nature of the error.
92-
* The [arguments] are any arguments needed to complete the error message.
93-
*/
94-
typedef ReportError(
95-
ScannerErrorCode errorCode, int offset, List<Object> arguments);
9+
import 'token_constants.dart';
9610

9711
/**
9812
* Translates the given error [token] into an analyzer error and reports it
@@ -190,3 +104,94 @@ bool _isAtEnd(Token token, int charOffset) {
190104
// Otherwise keep looking.
191105
}
192106
}
107+
108+
/**
109+
* Used to report a scan error at the given offset.
110+
* The [errorCode] is the error code indicating the nature of the error.
111+
* The [arguments] are any arguments needed to complete the error message.
112+
*/
113+
typedef ReportError(
114+
ScannerErrorCode errorCode, int offset, List<Object> arguments);
115+
116+
/**
117+
* The error codes used for errors detected by the scanner.
118+
*/
119+
class ScannerErrorCode extends ErrorCode {
120+
/**
121+
* Parameters:
122+
* 0: the token that was expected but not found
123+
*/
124+
static const ScannerErrorCode EXPECTED_TOKEN =
125+
const ScannerErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'.");
126+
127+
/**
128+
* Parameters:
129+
* 0: the illegal character
130+
*/
131+
static const ScannerErrorCode ILLEGAL_CHARACTER =
132+
const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character '{0}'.");
133+
134+
static const ScannerErrorCode MISSING_DIGIT =
135+
const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected.");
136+
137+
static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode(
138+
'MISSING_HEX_DIGIT', "Hexadecimal digit expected.");
139+
140+
static const ScannerErrorCode MISSING_IDENTIFIER =
141+
const ScannerErrorCode('MISSING_IDENTIFIER', "Expected an identifier.");
142+
143+
static const ScannerErrorCode MISSING_QUOTE =
144+
const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \").");
145+
146+
/**
147+
* Parameters:
148+
* 0: the path of the file that cannot be read
149+
*/
150+
static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode(
151+
'UNABLE_GET_CONTENT', "Unable to get content of '{0}'.");
152+
153+
static const ScannerErrorCode UNEXPECTED_DOLLAR_IN_STRING =
154+
const ScannerErrorCode(
155+
'UNEXPECTED_DOLLAR_IN_STRING',
156+
"A '\$' has special meaning inside a string, and must be followed by "
157+
"an identifier or an expression in curly braces ({}).",
158+
correction: "Try adding a backslash (\\) to escape the '\$'.");
159+
160+
/**
161+
* Parameters:
162+
* 0: the unsupported operator
163+
*/
164+
static const ScannerErrorCode UNSUPPORTED_OPERATOR = const ScannerErrorCode(
165+
'UNSUPPORTED_OPERATOR', "The '{0}' operator is not supported.");
166+
167+
static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
168+
const ScannerErrorCode(
169+
'UNTERMINATED_MULTI_LINE_COMMENT', "Unterminated multi-line comment.",
170+
correction: "Try terminating the comment with '*/', or "
171+
"removing any unbalanced occurrences of '/*'"
172+
" (because comments nest in Dart).");
173+
174+
static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
175+
const ScannerErrorCode(
176+
'UNTERMINATED_STRING_LITERAL', "Unterminated string literal.");
177+
178+
/**
179+
* Initialize a newly created error code to have the given [name]. The message
180+
* associated with the error will be created from the given [message]
181+
* template. The correction associated with the error will be created from the
182+
* given [correction] template.
183+
*/
184+
const ScannerErrorCode(String name, String message, {String correction})
185+
: super(
186+
correction: correction,
187+
message: message,
188+
name: name,
189+
uniqueName: 'ScannerErrorCode.$name',
190+
);
191+
192+
@override
193+
ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
194+
195+
@override
196+
ErrorType get type => ErrorType.SYNTACTIC_ERROR;
197+
}

pkg/_fe_analyzer_shared/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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

66
environment:
7-
sdk: '>=2.2.2 <3.0.0'
7+
sdk: '>=2.6.0 <3.0.0'
88
dependencies:
99
meta: ^1.0.2
1010
dev_dependencies:

0 commit comments

Comments
 (0)