Version 2.12.0-273.0.dev

Merge commit '3eb117c24e770187a078412b419c636570670865' into 'dev'
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 2bee3dc..5f442af 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -481,6 +481,7 @@
   FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS,
   FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS,
   FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH,
+  HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR,
   HintCode.ASSIGNMENT_OF_DO_NOT_STORE,
   HintCode.CAN_BE_NULL_AFTER_NULL_AWARE,
   HintCode.DEAD_CODE,
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
index 696fc45..28463aa 100644
--- a/pkg/analyzer/lib/src/dart/error/hint_codes.dart
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
@@ -15,6 +15,17 @@
  */
 class HintCode extends AnalyzerErrorCode {
   /**
+   * Parameters:
+   * 0: the name of the actual argument type
+   * 1: the name of the expected function return type
+   */
+  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR =
+      HintCode(
+          'ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR',
+          "The argument type '{0}' can't be assigned to the parameter type "
+              "'{1} Function(Object)' or '{1} Function(Object, StackTrace)'.");
+
+  /**
    * Users should not assign values marked `@doNotStore`.
    */
   static const HintCode ASSIGNMENT_OF_DO_NOT_STORE = HintCode(
diff --git a/pkg/analyzer/lib/src/error/catch_error_verifier.dart b/pkg/analyzer/lib/src/error/catch_error_verifier.dart
index a9fa26d..98d775a0 100644
--- a/pkg/analyzer/lib/src/error/catch_error_verifier.dart
+++ b/pkg/analyzer/lib/src/error/catch_error_verifier.dart
@@ -52,6 +52,8 @@
     var targetFutureType = targetType.typeArguments.first;
     var expectedReturnType = _typeProvider.futureOrType2(targetFutureType);
     if (callback is FunctionExpression) {
+      _checkOnErrorFunctionType(
+          callback, callback.staticType, expectedReturnType);
       var catchErrorOnErrorExecutable = EnclosingExecutableContext(
           callback.declaredElement,
           isAsynchronous: true,
@@ -64,10 +66,56 @@
       var callbackType = callback.staticType;
       if (callbackType is FunctionType) {
         _checkReturnType(expectedReturnType, callbackType.returnType, callback);
+        _checkOnErrorFunctionType(callback, callbackType, expectedReturnType);
+      } else {
+        // If [callback] is not even a Function, then ErrorVerifier will have
+        // reported this.
       }
     }
   }
 
+  void _checkOnErrorFunctionType(Expression expression,
+      FunctionType expressionType, DartType expectedFunctionReturnType) {
+    void report() {
+      _errorReporter.reportErrorForNode(
+        HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR,
+        expression,
+        [expressionType, expectedFunctionReturnType],
+      );
+    }
+
+    var parameters = expressionType.parameters;
+    if (parameters == null || parameters.isEmpty) {
+      return report();
+    }
+    var firstParameter = parameters.first;
+    if (firstParameter.isNamed) {
+      return report();
+    } else if (firstParameter.isOptionalPositional) {
+      return report();
+    } else {
+      if (!_typeSystem.isSubtypeOf(
+          _typeProvider.objectType, firstParameter.type)) {
+        return report();
+      }
+    }
+    if (parameters.length == 2) {
+      var secondParameter = parameters[1];
+      if (secondParameter.isNamed) {
+        return report();
+      } else if (firstParameter.isOptionalPositional) {
+        return report();
+      } else {
+        if (!_typeSystem.isSubtypeOf(
+            _typeProvider.stackTraceType, secondParameter.type)) {
+          return report();
+        }
+      }
+    } else if (parameters.length > 2) {
+      return report();
+    }
+  }
+
   void _checkReturnType(
       DartType expectedType, DartType functionReturnType, Expression callback) {
     if (!_typeSystem.isAssignableTo(functionReturnType, expectedType)) {
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index c9a953d..a14bdfb 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -1605,10 +1605,7 @@
   }
 
   /// Verify that the given [expression] can be assigned to its corresponding
-  /// parameters. The [expectedStaticType] is the expected static type.
-  ///
-  /// This method corresponds to
-  /// [BestPracticesVerifier.checkForArgumentTypeNotAssignableWithExpectedTypes].
+  /// parameters.
   ///
   /// See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE],
   /// [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE],
diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_catch_error_on_error_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_catch_error_on_error_test.dart
new file mode 100644
index 0000000..704f988
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_catch_error_on_error_test.dart
@@ -0,0 +1,264 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../dart/resolution/context_collection_resolution.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ArgumentTypeNotAssignableCatchErrorOnErrorTest);
+    defineReflectiveTests(
+        ArgumentTypeNotAssignableCatchErrorOnErrorWithNullSafetyTest);
+  });
+}
+
+@reflectiveTest
+class ArgumentTypeNotAssignableCatchErrorOnErrorTest
+    extends PubPackageResolutionTest {
+  void test_firstParameterIsDynamic() async {
+    await assertNoErrorsInCode('''
+void f(Future<int> future, Future<int> Function(dynamic a) callback) {
+  future.catchError(callback);
+}
+''');
+  }
+
+  void test_firstParameterIsNamed() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function({Object a}) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 92, 8),
+    ]);
+  }
+
+  void test_firstParameterIsOptional() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function([Object a]) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 92, 8),
+    ]);
+  }
+
+  void test_functionExpression_firstParameterIsDynamic() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((dynamic a) {});
+}
+''');
+  }
+
+  void test_functionExpression_firstParameterIsImplicit() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((a) {});
+}
+''');
+  }
+
+  void test_functionExpression_firstParameterIsNamed() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError(({Object a = 1}) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 19),
+    ]);
+  }
+
+  void test_functionExpression_firstParameterIsOptional() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError(([Object a = 1]) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 19),
+    ]);
+  }
+
+  void test_functionExpression_firstParameterIsVar() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((var a) {});
+}
+''');
+  }
+
+  void test_functionExpression_noParameters() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError(() {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 5),
+    ]);
+  }
+
+  void test_functionExpression_secondParameterIsDynamic() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, dynamic b) {});
+}
+''');
+  }
+
+  void test_functionExpression_secondParameterIsImplicit() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, b) {});
+}
+''');
+  }
+
+  void test_functionExpression_secondParameterIsNamed() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, {StackTrace b}) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 29),
+    ]);
+  }
+
+  void test_functionExpression_secondParameterIsVar() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, var b) {});
+}
+''');
+  }
+
+  void test_functionExpression_tooManyParameters() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((a, b, c) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 12),
+    ]);
+  }
+
+  void test_functionExpression_wrongFirstParameterType() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((String a) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 13),
+    ]);
+  }
+
+  void test_functionExpression_wrongSecondParameterType() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, String b) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 23),
+    ]);
+  }
+
+  void test_noParameters() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function() callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 82, 8),
+    ]);
+  }
+
+  void test_okType() async {
+    await assertNoErrorsInCode('''
+void f(Future<int> future, Future<int> Function(Object, StackTrace) callback) {
+  future.catchError(callback);
+}
+''');
+  }
+
+  void test_secondParameterIsDynamic() async {
+    await assertNoErrorsInCode('''
+void f(Future<int> future, Future<int> Function(Object a, dynamic b) callback) {
+  future.catchError(callback);
+}
+''');
+  }
+
+  void test_secondParameterIsNamed() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function(Object a, {StackTrace b}) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 106, 8),
+    ]);
+  }
+
+  void test_tooManyParameters() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function(int, int, int) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 95, 8),
+    ]);
+  }
+
+  void test_wrongSecondParameterType() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function(Object, String) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 96, 8),
+    ]);
+  }
+
+  voidtest_wrongFirstParameterType() async {
+    await assertErrorsInCode('''
+void f(Future<int> future, Future<int> Function(String) callback) {
+  future.catchError(callback);
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 88, 8),
+    ]);
+  }
+}
+
+@reflectiveTest
+class ArgumentTypeNotAssignableCatchErrorOnErrorWithNullSafetyTest
+    extends ArgumentTypeNotAssignableCatchErrorOnErrorTest
+    with WithNullSafetyMixin {
+  void test_functionExpression_firstParameterIsNullableObject() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object? a) {});
+}
+''');
+  }
+
+  @override
+  void test_functionExpression_secondParameterIsNamed() async {
+    await assertErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, {required StackTrace b}) {});
+}
+''', [
+      error(HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR, 50, 38),
+    ]);
+  }
+
+  void test_functionExpression_secondParameterIsNullableStackTrace() async {
+    await assertNoErrorsInCode('''
+void f(Future<void> future) {
+  future.catchError((Object a, StackTrace? b) {});
+}
+''');
+  }
+}
diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart
index 6d808e0..49d3869 100644
--- a/pkg/analyzer/test/src/diagnostics/test_all.dart
+++ b/pkg/analyzer/test/src/diagnostics/test_all.dart
@@ -17,6 +17,8 @@
 import 'ambiguous_set_or_map_literal_test.dart' as ambiguous_set_or_map_literal;
 import 'annotation_on_pointer_field_test.dart' as annotation_on_pointer_field;
 import 'annotation_syntax_test.dart' as annotation_syntax;
+import 'argument_type_not_assignable_catch_error_on_error_test.dart'
+    as argument_type_not_assignable_catch_error_on_error;
 import 'argument_type_not_assignable_test.dart' as argument_type_not_assignable;
 import 'assert_in_redirecting_constructor_test.dart'
     as assert_in_redirecting_constructor;
@@ -677,6 +679,7 @@
     annotation_on_pointer_field.main();
     annotation_syntax.main();
     argument_type_not_assignable.main();
+    argument_type_not_assignable_catch_error_on_error.main();
     assert_in_redirecting_constructor.main();
     assignment_of_do_not_store.main();
     assignment_to_const.main();
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
index f1541bb..8177839 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
@@ -188,7 +188,7 @@
       return new dart._internal::SkipWhileIterable::•<dart.core::int*>(this, test);
     }
     method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
-      return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, count);
+      return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, dart._internal::checkNotNullable<dart.core::int>(count, "count"));
     method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::TakeWhileIterable::•<dart.core::int*>(this, test);
     }
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
index f1541bb..8177839 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
@@ -188,7 +188,7 @@
       return new dart._internal::SkipWhileIterable::•<dart.core::int*>(this, test);
     }
     method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
-      return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, count);
+      return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, dart._internal::checkNotNullable<dart.core::int>(count, "count"));
     method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::TakeWhileIterable::•<dart.core::int*>(this, test);
     }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_array.dart b/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
index a6522bd..3076131 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
@@ -217,7 +217,7 @@
   }
 
   Iterable<E> take(int n) {
-    return SubListIterable<E>(this, 0, n);
+    return new SubListIterable<E>(this, 0, checkNotNullable(n, "count"));
   }
 
   Iterable<E> takeWhile(bool test(E value)) {
diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart
index ffefd1f..f0024ca 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart
@@ -331,7 +331,7 @@
   }
 
   Iterable<E> take(int n) {
-    return new SubListIterable<E>(this, 0, n);
+    return new SubListIterable<E>(this, 0, checkNotNullable(n, "count"));
   }
 
   Iterable<E> takeWhile(bool test(E value)) {
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 327a7ea..0762f4b 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -248,7 +248,8 @@
     return SkipWhileIterable<E>(this, test);
   }
 
-  Iterable<E> take(int count) => SubListIterable<E>(this, 0, count);
+  Iterable<E> take(int count) =>
+      SubListIterable<E>(this, 0, checkNotNullable(count, "count"));
 
   Iterable<E> takeWhile(bool test(E element)) {
     return TakeWhileIterable<E>(this, test);
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 55134af..8b09946 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -204,7 +204,8 @@
 
   Iterable<E> skipWhile(bool test(E element)) => super.skipWhile(test);
 
-  Iterable<E> take(int count) => new SubListIterable<E>(this, 0, count);
+  Iterable<E> take(int count) =>
+      SubListIterable<E>(this, 0, checkNotNullable(count, "count"));
 
   Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test);
 
diff --git a/tests/corelib/iterable_take_test.dart b/tests/corelib/iterable_take_test.dart
index 59cd518..13ba1dc 100644
--- a/tests/corelib/iterable_take_test.dart
+++ b/tests/corelib/iterable_take_test.dart
@@ -180,4 +180,28 @@
   Expect.throwsRangeError(() => list3.map((x) => x).skip(-1));
   Expect.throwsRangeError(() => set1.map((x) => x).skip(-1));
   Expect.throwsRangeError(() => set2.map((x) => x).skip(-1));
+
+  // Iterable<dynamic>.
+  var take5 = set2.take(0);
+  var it3 = take5.iterator;
+  Expect.isNull(it3.current);
+  Expect.isFalse(it3.moveNext());
+  Expect.isNull(it3.current);
+
+  take5 = set2.take(1);
+  it3 = take5.iterator;
+  Expect.isNull(it3.current);
+  Expect.isFalse(it3.moveNext());
+  Expect.isNull(it3.current);
+
+  Expect.throws(() => list1.take(-1), (e) => e is RangeError);
+  Expect.throws(() => list2.take(-1), (e) => e is RangeError);
+  Expect.throws(() => list3.take(-1), (e) => e is RangeError);
+  Expect.throws(() => set1.take(-1), (e) => e is RangeError);
+  Expect.throws(() => set2.take(-1), (e) => e is RangeError);
+  Expect.throws(() => list1.map((x) => x).take(-1), (e) => e is RangeError);
+  Expect.throws(() => list2.map((x) => x).take(-1), (e) => e is RangeError);
+  Expect.throws(() => list3.map((x) => x).take(-1), (e) => e is RangeError);
+  Expect.throws(() => set1.map((x) => x).take(-1), (e) => e is RangeError);
+  Expect.throws(() => set2.map((x) => x).take(-1), (e) => e is RangeError);
 }
diff --git a/tests/corelib_2/iterable_take_test.dart b/tests/corelib_2/iterable_take_test.dart
index fccb5a2..826f6f5 100644
--- a/tests/corelib_2/iterable_take_test.dart
+++ b/tests/corelib_2/iterable_take_test.dart
@@ -224,4 +224,15 @@
   Expect.throwsRangeError(() => list3.map((x) => x).skip(-1));
   Expect.throwsRangeError(() => set1.map((x) => x).skip(-1));
   Expect.throwsRangeError(() => set2.map((x) => x).skip(-1));
+
+  Expect.throws(() => list1.take(null));
+  Expect.throws(() => list2.take(null));
+  Expect.throws(() => list3.take(null));
+  Expect.throws(() => set1.take(null));
+  Expect.throws(() => set2.take(null));
+  Expect.throws(() => list1.map((x) => x).take(null));
+  Expect.throws(() => list2.map((x) => x).take(null));
+  Expect.throws(() => list3.map((x) => x).take(null));
+  Expect.throws(() => set1.map((x) => x).take(null));
+  Expect.throws(() => set2.map((x) => x).take(null));
 }
diff --git a/tools/VERSION b/tools/VERSION
index 6fdb2fb..41eeca7 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 12
 PATCH 0
-PRERELEASE 272
+PRERELEASE 273
 PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 29f0ba2..3d7a822 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -625,12 +625,14 @@
     },
     "dart2js-hostasserts-(linux|mac|win)-(ia32|x64)-d8": {
       "options": {
-        "host-checked": true
+        "host-checked": true,
+        "timeout": 240
       }
     },
     "dart2js-hostasserts-(linux|mac|win)-(ia32|x64)-d8-unsound": {
       "options": {
         "host-checked": true,
+        "timeout": 240,
         "dart2js-options": [
           "--no-sound-null-safety"
         ]
@@ -638,70 +640,70 @@
     },
     "dart2js-hostasserts-weak-(linux|win)-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-weak",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dart2js-hostasserts-weak-max-fragments-(linux|win)-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-weak",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/",
           "--merge-fragments-threshold=3"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dart2js-hostasserts-weak-mac-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-weak",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=xcodebuild/ReleaseX64/"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dart2js-hostasserts-strong-(linux|win)-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-strong",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dart2js-hostasserts-strong-max-fragments-(linux|win)-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-strong",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/",
           "--merge-fragments-threshold=3"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dart2js-hostasserts-strong-mac-x64-(d8|chrome)": {
       "options": {
+        "host-checked": true,
+        "timeout": 240,
         "builder-tag": "dart2js-strong",
         "dart2js-options": [
           "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=xcodebuild/ReleaseX64/"
-        ],
-        "timeout": 240,
-        "host-checked": true
+        ]
       }
     },
     "dartkp-android-(debug|product|release)-arm_x64": {