Update List constructor documentation, deprecate constructor.

Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
Lasse R.H. Nielsen
2020-12-07 16:20:28 +00:00
committed by commit-bot@chromium.org
parent fd2a6c6815
commit 6e29700e16
197 changed files with 563 additions and 522 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ class Path {
while (common < length && pathSegments[common] == baseSegments[common]) {
common++;
}
final segments = new List<String>();
final segments = <String>[];
if (common < baseSegments.length && baseSegments[common] == '..') {
throw new ArgumentError("Invalid case of Path.relativeTo(base):\n"
@@ -53,7 +53,7 @@ class Tokenizer {
String expression;
List<String> tokens;
Tokenizer(String this.expression) : tokens = new List<String>();
Tokenizer(String this.expression) : tokens = <String>[];
// Tokens are : "(", ")", "$", ",", "&&", "||", "==", "!=", and (maximal) \w+.
static final testRegexp =
@@ -35,9 +35,9 @@ class Section {
Section.always(this.statusFile, this.lineNumber)
: condition = null,
testRules = new List<TestRule>();
testRules = <TestRule>[];
Section(this.statusFile, this.condition, this.lineNumber)
: testRules = new List<TestRule>();
: testRules = <TestRule>[];
bool isEnabled(Map<String, String> environment) =>
condition == null || condition.evaluate(environment);
@@ -58,7 +58,7 @@ Future<TestExpectations> ReadTestExpectations(List<String> statusFilePaths,
Future<void> ReadTestExpectationsInto(TestExpectations expectations,
String statusFilePath, Map<String, String> environment) {
var completer = new Completer();
List<Section> sections = new List<Section>();
List<Section> sections = <Section>[];
void sectionsRead() {
for (Section section in sections) {
@@ -233,7 +233,7 @@ class TestExpectations {
_map.forEach((key, expectations) {
if (_keyToRegExps[key] != null) return;
var splitKey = key.split('/');
var regExps = new List<RegExp>(splitKey.length);
var regExps = new List<RegExp>.filled(splitKey.length, null);
for (var i = 0; i < splitKey.length; i++) {
var component = splitKey[i];
var regExp = _regExpCache[component];