Skip to content

Commit db7eb25

Browse files
author
Dart CI
committed
Version 2.11.0-167.0.dev
Merge commit 'f0d1fe173c2474bea3d0f6b1c22405fa0f884021' into 'dev'
2 parents 4fb134a + f0d1fe1 commit db7eb25

File tree

10 files changed

+60
-6
lines changed

10 files changed

+60
-6
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ vars = {
101101
"ffi_rev": "454ab0f9ea6bd06942a983238d8a6818b1357edb",
102102
"fixnum_rev": "16d3890c6dc82ca629659da1934e412292508bba",
103103
"glob_rev": "e9f4e6b7ae8abe5071461cf8f47191bb19cf7ef6",
104-
"html_rev": "083a36cd801a4b787ba156b7c6e4c8b2e2daed4a",
104+
"html_rev": "22f17e97fedeacaa1e945cf84d8016284eed33a6",
105105
"http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b",
106106
"http_multi_server_rev" : "ea269f79321d659208402088f3297e8920a88ee6",
107107
"http_parser_rev": "6e63a97b5aaa2b4d1215fe01683e51fb73258e54",

pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import 'package:analysis_server/src/services/correction/dart/convert_to_relative
2727
import 'package:analysis_server/src/services/correction/dart/convert_to_set_literal.dart';
2828
import 'package:analysis_server/src/services/correction/dart/convert_to_where_type.dart';
2929
import 'package:analysis_server/src/services/correction/dart/create_method.dart';
30+
import 'package:analysis_server/src/services/correction/dart/inline_invocation.dart';
3031
import 'package:analysis_server/src/services/correction/dart/make_final.dart';
3132
import 'package:analysis_server/src/services/correction/dart/remove_argument.dart';
3233
import 'package:analysis_server/src/services/correction/dart/remove_await.dart';
@@ -175,6 +176,10 @@ class BulkFixProcessor {
175176
LintNames.prefer_if_null_operators: [
176177
ConvertToIfNull.newInstance,
177178
],
179+
LintNames.prefer_inlined_adds: [
180+
ConvertAddAllToSpread.newInstance,
181+
InlineInvocation.newInstance,
182+
],
178183
LintNames.prefer_int_literals: [
179184
ConvertToIntLiteral.newInstance,
180185
],
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:analysis_server/src/services/linter/lint_names.dart';
6+
import 'package:test_reflective_loader/test_reflective_loader.dart';
7+
8+
import 'bulk_fix_processor.dart';
9+
10+
void main() {
11+
defineReflectiveSuite(() {
12+
defineReflectiveTests(InlineInvocationTest);
13+
});
14+
}
15+
16+
@reflectiveTest
17+
class InlineInvocationTest extends BulkFixProcessorTest {
18+
@override
19+
String get lintCode => LintNames.prefer_inlined_adds;
20+
21+
Future<void> test_singleFile() async {
22+
await resolveTestUnit('''
23+
var l = []..add('a')..add('b');
24+
var l2 = ['a', 'b']..add('c');
25+
var l3 = ['a']..addAll(['b', 'c']);
26+
''');
27+
await assertHasFix('''
28+
var l = ['a']..add('b');
29+
var l2 = ['a', 'b', 'c'];
30+
var l3 = ['a', 'b', 'c'];
31+
''');
32+
}
33+
}

pkg/analysis_server/test/src/services/correction/fix/bulk/test_all.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import 'convert_to_single_quoted_strings_test.dart'
2929
import 'convert_to_spread_test.dart' as convert_to_spread;
3030
import 'convert_to_where_type_test.dart' as convert_to_where_type;
3131
import 'create_method_test.dart' as create_method;
32+
import 'inline_invocation_test.dart' as inline_invocation;
3233
import 'make_final_test.dart' as make_final;
3334
import 'remove_argument_test.dart' as remove_argument;
3435
import 'remove_await_test.dart' as remove_await;
@@ -83,6 +84,7 @@ void main() {
8384
convert_to_spread.main();
8485
convert_to_where_type.main();
8586
create_method.main();
87+
inline_invocation.main();
8688
make_final.main();
8789
remove_argument.main();
8890
remove_await.main();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:analysis_server/src/services/correction/bulk_fix_processor.dart';
6+
7+
/// Print lints that are bulk-fixable in a format that can be included in
8+
/// analysis options.
9+
void main() {
10+
print(' # bulk-fixable lints');
11+
for (var lintName in BulkFixProcessor.lintProducerMap.keys) {
12+
print(' - $lintName');
13+
}
14+
}

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40160,7 +40160,7 @@ Function _registerCustomElement(context, document, String tag, [Map? options]) {
4016040160
// ...
4016140161
// var e = document.createElement('x-foo');
4016240162

40163-
var extendsTagName = '';
40163+
String? extendsTagName = '';
4016440164
Type? type;
4016540165
if (options != null) {
4016640166
extendsTagName = options['extends'];

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 11
2929
PATCH 0
30-
PRERELEASE 166
30+
PRERELEASE 167
3131
PRERELEASE_PATCH 0

tools/dom/src/dart2js_CustomElementSupport.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Function _registerCustomElement(context, document, String tag, [Map? options]) {
8181
// ...
8282
// var e = document.createElement('x-foo');
8383

84-
var extendsTagName = '';
84+
String? extendsTagName = '';
8585
Type? type;
8686
if (options != null) {
8787
extendsTagName = options['extends'];

tools/dom/templates/html/impl/impl_Element.darttemplate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ $endif
13901390
contextElement = _parseDocument$NULLASSERT.createElement(tagName);
13911391
_parseDocument$NULLASSERT.body$NULLASSERT.append(contextElement);
13921392
}
1393-
var fragment;
1393+
DocumentFragment fragment;
13941394
if (Range.supportsCreateContextualFragment &&
13951395
_canBeUsedToCreateContextualFragment) {
13961396
_parseRange$NULLASSERT.selectNodeContents(contextElement);

tools/dom/templates/html/impl/impl_IDBFactory.darttemplate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
2424
'version and onUpgradeNeeded must be specified together'));
2525
}
2626
try {
27-
var request;
27+
OpenDBRequest request;
2828
if (version != null) {
2929
request = _open(name, version);
3030
} else {

0 commit comments

Comments
 (0)