diff --git a/benchmarks/IsolateJson/dart/IsolateJson.dart b/benchmarks/IsolateJson/dart/IsolateJson.dart index ccf80e5a0b3..0d7486d5b6e 100644 --- a/benchmarks/IsolateJson/dart/IsolateJson.dart +++ b/benchmarks/IsolateJson/dart/IsolateJson.dart @@ -38,7 +38,7 @@ class JsonDecodingBenchmark { final bool useSendAndExit; } -Uint8List createSampleJson(final size) { +Uint8List createSampleJson(size) { final list = List.generate(size, (i) => i); final map = {}; for (int i = 0; i < size; i++) { diff --git a/runtime/tests/vm/dart/byte_array_optimized_test.dart b/runtime/tests/vm/dart/byte_array_optimized_test.dart index 83b39fedd15..d636dd87879 100644 --- a/runtime/tests/vm/dart/byte_array_optimized_test.dart +++ b/runtime/tests/vm/dart/byte_array_optimized_test.dart @@ -1540,7 +1540,7 @@ class OptimizedByteArrayTest { testFloat64ListImpl(array); } - static testInt8ListViewImpl(var array) { + static testInt8ListViewImpl(array) { Expect.equals(12, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(12, array.lengthInBytes); @@ -1779,7 +1779,7 @@ class OptimizedByteArrayTest { testInt8ListViewImpl(array); } - static testUint8ListViewImpl(var array) { + static testUint8ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -1980,7 +1980,7 @@ class OptimizedByteArrayTest { testUint8ListViewImpl(array); } - static testInt16ListViewImpl(var array) { + static testInt16ListViewImpl(array) { Expect.equals(24, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(24, array.lengthInBytes); @@ -2341,7 +2341,7 @@ class OptimizedByteArrayTest { testInt16ListViewImpl(array); } - static testUint16ListViewImpl(var array) { + static testUint16ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(24, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -3144,7 +3144,7 @@ class OptimizedByteArrayTest { ], array); } - static testUint32ListViewImpl(var array) { + static testUint32ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(48, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -3542,7 +3542,7 @@ class OptimizedByteArrayTest { testUint32ListViewImpl(array); } - static testInt64ListViewImpl(var array) { + static testInt64ListViewImpl(array) { Expect.equals(96, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(96, array.lengthInBytes); @@ -4244,7 +4244,7 @@ class OptimizedByteArrayTest { testInt64ListViewImpl(array); } - static testUint64ListViewImpl(var array) { + static testUint64ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(96, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -4743,7 +4743,7 @@ class OptimizedByteArrayTest { testUint64ListViewImpl(array); } - static testFloat32ListViewImpl(var array) { + static testFloat32ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(4, array.elementSizeInBytes); @@ -4973,7 +4973,7 @@ class OptimizedByteArrayTest { testFloat32ListViewImpl(array); } - static testFloat64ListViewImpl(var array) { + static testFloat64ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(8, array.elementSizeInBytes); diff --git a/runtime/tests/vm/dart/byte_array_test.dart b/runtime/tests/vm/dart/byte_array_test.dart index db1704ea1a1..4805c019b9a 100644 --- a/runtime/tests/vm/dart/byte_array_test.dart +++ b/runtime/tests/vm/dart/byte_array_test.dart @@ -2107,7 +2107,7 @@ class ByteArrayTest { // TODO: byte_array.getFloat64(0) } - static testInt8ListViewImpl(var array) { + static testInt8ListViewImpl(array) { Expect.equals(12, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(12, array.lengthInBytes); @@ -2346,7 +2346,7 @@ class ByteArrayTest { testInt8ListViewImpl(array); } - static testUint8ListViewImpl(var array) { + static testUint8ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -2547,7 +2547,7 @@ class ByteArrayTest { testUint8ListViewImpl(array); } - static testInt16ListViewImpl(var array) { + static testInt16ListViewImpl(array) { Expect.equals(24, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(24, array.lengthInBytes); @@ -2908,7 +2908,7 @@ class ByteArrayTest { testInt16ListViewImpl(array); } - static testUint16ListViewImpl(var array) { + static testUint16ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(24, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -3711,7 +3711,7 @@ class ByteArrayTest { ], array); } - static testUint32ListViewImpl(var array) { + static testUint32ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(48, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -4109,7 +4109,7 @@ class ByteArrayTest { testUint32ListViewImpl(array); } - static testInt64ListViewImpl(var array) { + static testInt64ListViewImpl(array) { Expect.equals(96, array.length); Expect.equals(1, array.elementSizeInBytes); Expect.equals(96, array.lengthInBytes); @@ -4811,7 +4811,7 @@ class ByteArrayTest { testInt64ListViewImpl(array); } - static testUint64ListViewImpl(var array) { + static testUint64ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(96, array.length); Expect.equals(1, array.elementSizeInBytes); @@ -5310,7 +5310,7 @@ class ByteArrayTest { testUint64ListViewImpl(array); } - static testFloat32ListViewImpl(var array) { + static testFloat32ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(4, array.elementSizeInBytes); @@ -5540,7 +5540,7 @@ class ByteArrayTest { testFloat32ListViewImpl(array); } - static testFloat64ListViewImpl(var array) { + static testFloat64ListViewImpl(array) { Expect.isTrue(array is List); Expect.equals(12, array.length); Expect.equals(8, array.elementSizeInBytes); diff --git a/runtime/tests/vm/dart/inline_local_functions_il_test.dart b/runtime/tests/vm/dart/inline_local_functions_il_test.dart index 1f9ecf06ca3..4fad0c655a5 100644 --- a/runtime/tests/vm/dart/inline_local_functions_il_test.dart +++ b/runtime/tests/vm/dart/inline_local_functions_il_test.dart @@ -14,7 +14,7 @@ int run(int Function() fn) => fn(); @pragma('vm:testing:match-inner-flow-graph', 'foo') void main() { const int N = 100; - int id(final int i) => i; + int id(int i) => i; @pragma('vm:testing:print-flow-graph') int foo() { diff --git a/runtime/tests/vm/dart/inline_stack_frame_test.dart b/runtime/tests/vm/dart/inline_stack_frame_test.dart index 614357188b8..b48606bce0c 100644 --- a/runtime/tests/vm/dart/inline_stack_frame_test.dart +++ b/runtime/tests/vm/dart/inline_stack_frame_test.dart @@ -18,7 +18,7 @@ class Test { @pragma("vm:entry-point") - String func1(var k) { + String func1(k) { try { for (var i = 0; i <= 50; i++) { func2(i * k); @@ -31,7 +31,7 @@ class Test { } @pragma("vm:entry-point") - int func2(var i) { + int func2(i) { var result = 0; for (var k = 0; k <= 10; k++) { result += func3(i + k); @@ -40,7 +40,7 @@ class Test { } @pragma("vm:entry-point") - int func3(var i) { + int func3(i) { var result = 0; for (var l = 0; l <= 1; l++) { result += func4(i + l); @@ -49,7 +49,7 @@ class Test { } @pragma("vm:entry-point") - int func4(var i) { + int func4(i) { var result = 0; for (var j = 0; j <= 10; j++) { result += func5(i + j); @@ -58,7 +58,7 @@ class Test { } @pragma("vm:entry-point") - int func5(var i) { + int func5(i) { if (i >= 520) throw "show me inlined functions"; return i; } diff --git a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart index 1c5c2be185b..d15b34231d2 100644 --- a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart +++ b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart @@ -166,7 +166,7 @@ final copyableClosures = [ return inner; }(), () { - foo(var arg) { + foo(arg) { return () => arg; } diff --git a/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart b/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart index 160a3f3c7b3..afa6f85ccf8 100644 --- a/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart +++ b/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart @@ -41,7 +41,7 @@ final nonCopyableClosures = [ return inner; })(), (() { - foo(var arg) { + foo(arg) { return () => arg; } diff --git a/runtime/tests/vm/dart/issue_31959_31960_test.dart b/runtime/tests/vm/dart/issue_31959_31960_test.dart index f6c28c89491..da3f83a6c13 100644 --- a/runtime/tests/vm/dart/issue_31959_31960_test.dart +++ b/runtime/tests/vm/dart/issue_31959_31960_test.dart @@ -10,7 +10,7 @@ import 'dart:typed_data'; import 'package:expect/async_helper.dart' show asyncStart, asyncEnd; import 'package:expect/expect.dart'; -Uint8List generateSampleList(final int size) { +Uint8List generateSampleList(int size) { final list = Uint8List(size); for (int i = 0; i < size; i++) { list[i] = i % 243; @@ -18,7 +18,7 @@ Uint8List generateSampleList(final int size) { return list; } -void validateReceivedList(final int expectedSize, final list) { +void validateReceivedList(int expectedSize, list) { Expect.equals(expectedSize, list.length); // probe few elements for ( diff --git a/runtime/tests/vm/dart/random_walk_fuzzer.dart b/runtime/tests/vm/dart/random_walk_fuzzer.dart index 066e403518f..99f8c165a4e 100644 --- a/runtime/tests/vm/dart/random_walk_fuzzer.dart +++ b/runtime/tests/vm/dart/random_walk_fuzzer.dart @@ -102,7 +102,7 @@ List> candidateReceivers = >[]; List> candidateArguments = >[]; -void addInstance(var instance) { +void addInstance(instance) { addInstanceMirror(reflect(instance)); } diff --git a/runtime/tests/vm/dart/transferable_throws_test.dart b/runtime/tests/vm/dart/transferable_throws_test.dart index b1585e11120..0de3bb45da6 100644 --- a/runtime/tests/vm/dart/transferable_throws_test.dart +++ b/runtime/tests/vm/dart/transferable_throws_test.dart @@ -64,7 +64,7 @@ throwsIfReceiverMaterializesMoreThanOnce() async { isolateErrors.close(); } -void receiver(final transferable) { +void receiver(transferable) { transferable.materialize(); transferable.materialize(); } diff --git a/runtime/tests/vm/dart/truncating_ints_test.dart b/runtime/tests/vm/dart/truncating_ints_test.dart index a988482686e..326030d3c10 100644 --- a/runtime/tests/vm/dart/truncating_ints_test.dart +++ b/runtime/tests/vm/dart/truncating_ints_test.dart @@ -9,16 +9,16 @@ import "package:expect/expect.dart"; @pragma('vm:never-inline') -add_smi(var a, var b) => a + b; +add_smi(a, b) => a + b; @pragma('vm:never-inline') -add_mint(var a, var b) => a + b; +add_mint(a, b) => a + b; @pragma('vm:never-inline') add_mint_consts() => 0x5000000000000000 + 0x6000000000000000; @pragma('vm:never-inline') -test_add(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { +test_add(v2, v3, v3fxx, v5fxx, v7fxx, n60xx) { for (var i = 0; i < 20; i++) { Expect.equals(5, add_smi(v2, v3)); } @@ -44,16 +44,16 @@ test_add(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { } @pragma('vm:never-inline') -sub_smi(var a, var b) => a - b; +sub_smi(a, b) => a - b; @pragma('vm:never-inline') -sub_mint(var a, var b) => a - b; +sub_mint(a, b) => a - b; @pragma('vm:never-inline') sub_mint_consts() => (-0x5000000000000000) - 0x6000000000000000; @pragma('vm:never-inline') -test_sub(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { +test_sub(v2, v3, v3fxx, v5fxx, v7fxx, n60xx) { for (var i = 0; i < 20; i++) { Expect.equals(1, sub_smi(v3, v2)); } @@ -79,16 +79,16 @@ test_sub(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { } @pragma('vm:never-inline') -mul_smi(var a, var b) => a * b; +mul_smi(a, b) => a * b; @pragma('vm:never-inline') -mul_mint(var a, var b) => a * b; +mul_mint(a, b) => a * b; @pragma('vm:never-inline') mul_mint_consts() => 0x5000000000000001 * 0x6000000000000001; @pragma('vm:never-inline') -test_mul(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { +test_mul(v2, v3, v3fxx, v5fxx, v7fxx, n60xx) { for (var i = 0; i < 20; i++) { Expect.equals(6, mul_smi(v2, v3)); } @@ -110,25 +110,25 @@ test_mul(var v2, var v3, var v3fxx, var v5fxx, var v7fxx, var n60xx) { } @pragma('vm:never-inline') -shl_smi(var a, var b) => a << b; +shl_smi(a, b) => a << b; @pragma('vm:never-inline') -shl_mint(var a, var b) => a << b; +shl_mint(a, b) => a << b; @pragma('vm:never-inline') -shl_mint_by_const16(var a) => a << 16; +shl_mint_by_const16(a) => a << 16; @pragma('vm:never-inline') -shl_smi_by_const96(var a) => a << 96; +shl_smi_by_const96(a) => a << 96; @pragma('vm:never-inline') -shl_mint_by_const96(var a) => a << 96; +shl_mint_by_const96(a) => a << 96; @pragma('vm:never-inline') shl_mint_consts() => 0x77665544aabbccdd << 48; @pragma('vm:never-inline') -test_shl(var v2, var v3, var v8, var v40) { +test_shl(v2, v3, v8, v40) { for (var i = 0; i < 20; i++) { Expect.equals(16, shl_smi(v2, v3)); } diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h index bc5354dc32e..6795f67f91d 100644 --- a/runtime/vm/compiler/recognized_methods_list.h +++ b/runtime/vm/compiler/recognized_methods_list.h @@ -44,7 +44,7 @@ namespace dart { V(CoreLibrary, _Record, get:_numFields, Record_numFields, 0x7ba4f393) \ V(CoreLibrary, _Record, get:_shape, Record_shape, 0x70c40933) \ V(CoreLibrary, _Record, _fieldAt, Record_fieldAt, 0xb47fa0b3) \ - V(CoreLibrary, _StringBase, _interpolate, StringBaseInterpolate, 0xc2be3a8b) \ + V(CoreLibrary, _StringBase, _interpolate, StringBaseInterpolate, 0xecb2534a) \ V(CoreLibrary, _StringBase, codeUnitAt, StringBaseCodeUnitAt, 0x17dbf511) \ V(CoreLibrary, _IntegerImplementation, toDouble, IntegerToDouble, \ 0x97557386) \ diff --git a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart index 03763c3dd35..35625ec1714 100644 --- a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart +++ b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart @@ -654,7 +654,7 @@ class NoSuchMethodError { } var namedArguments = _namedArguments; if (namedArguments != null) { - namedArguments.forEach((Symbol key, var value) { + namedArguments.forEach((Symbol key, value) { sb.write(comma); sb.write(_symbolToString(key)); sb.write(": "); diff --git a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart index f54f7cd064a..e2a00495c7f 100644 --- a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart +++ b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart @@ -203,7 +203,7 @@ class _File { @patch class _Namespace { @patch - static void _setupNamespace(var namespace) { + static void _setupNamespace(namespace) { throw UnsupportedError("_Namespace"); } diff --git a/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart index 64695fcc928..7073bb63416 100644 --- a/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart +++ b/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart @@ -46,7 +46,7 @@ class Isolate { static Future spawnUri( Uri uri, List args, - var message, { + message, { bool paused = false, SendPort? onExit, SendPort? onError, diff --git a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart index 8f56484ba21..4ec00cf5b33 100644 --- a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart @@ -283,7 +283,7 @@ base class _HashMap extends MapBase implements HashMap { return result; } - void _addHashTableEntry(var table, K key, V value) { + void _addHashTableEntry(table, K key, V value) { if (!_hasTableEntry(table, key)) { _length++; _keys = null; @@ -291,7 +291,7 @@ base class _HashMap extends MapBase implements HashMap { _setTableEntry(table, key, value); } - V? _removeHashTableEntry(var table, Object? key) { + V? _removeHashTableEntry(table, Object? key) { if (table != null && _hasTableEntry(table, key)) { V value = _getTableEntry(table, key); _deleteTableEntry(table, key); @@ -303,25 +303,25 @@ base class _HashMap extends MapBase implements HashMap { } } - static bool _isStringKey(var key) { + static bool _isStringKey(key) { return key is String && key != '__proto__'; } - static bool _isNumericKey(var key) { + static bool _isNumericKey(key) { // Only treat unsigned 30-bit integers as numeric keys. This way, // we avoid converting them to strings when we use them as keys in // the JavaScript hash table object. return key is num && JS('bool', '(# & #) === #', key, _mask30, key); } - int _computeHashCode(var key) { + int _computeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', key.hashCode, _mask30); } - static bool _hasTableEntry(var table, var key) { + static bool _hasTableEntry(table, key) { var entry = JS('var', '#[#]', table, key); // We take care to only store non-null entries in the table, so we // can check if the table has an entry for the given key with a @@ -329,14 +329,14 @@ base class _HashMap extends MapBase implements HashMap { return entry != null; } - static _getTableEntry(var table, var key) { + static _getTableEntry(table, key) { var entry = JS('var', '#[#]', table, key); // We store the table itself as the entry to signal that it really // is a null value, so we have to map back to null here. return JS('bool', '# === #', entry, table) ? null : entry; } - static void _setTableEntry(var table, var key, var value) { + static void _setTableEntry(table, key, value) { // We only store non-null entries in the table, so we have to // change null values to refer to the table itself. Such values // will be recognized and mapped back to null on access. @@ -350,16 +350,16 @@ base class _HashMap extends MapBase implements HashMap { } } - static void _deleteTableEntry(var table, var key) { + static void _deleteTableEntry(table, key) { JS('void', 'delete #[#]', table, key); } - List? _getBucket(var table, var key) { + List? _getBucket(table, key) { var hash = _computeHashCode(key); return JS('var', '#[#]', table, hash); } - int _findBucketIndex(var bucket, var key) { + int _findBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i += 2) { @@ -383,14 +383,14 @@ base class _HashMap extends MapBase implements HashMap { } base class _IdentityHashMap extends _HashMap { - int _computeHashCode(var key) { + int _computeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', identityHashCode(key), _mask30); } - int _findBucketIndex(var bucket, var key) { + int _findBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i += 2) { @@ -427,14 +427,14 @@ base class _CustomHashMap extends _HashMap { return super._remove(key); } - int _computeHashCode(var key) { + int _computeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', _hashCode(key), _mask30); } - int _findBucketIndex(var bucket, var key) { + int _findBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i += 2) { @@ -585,14 +585,14 @@ base class _LinkedCustomHashMap extends JsLinkedHashMap { return super.internalRemove(key); } - int internalComputeHashCode(var key) { + int internalComputeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', _hashCode(key), _mask30); } - int internalFindBucketIndex(var bucket, var key) { + int internalFindBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -839,7 +839,7 @@ base class _HashSet extends _SetBase implements HashSet { return result; } - bool _addHashTableEntry(var table, E element) { + bool _addHashTableEntry(table, E element) { if (_hasTableEntry(table, element)) return false; _setTableEntry(table, element, 0); _length++; @@ -847,7 +847,7 @@ base class _HashSet extends _SetBase implements HashSet { return true; } - bool _removeHashTableEntry(var table, Object? element) { + bool _removeHashTableEntry(table, Object? element) { if (table != null && _hasTableEntry(table, element)) { _deleteTableEntry(table, element); _length--; @@ -858,11 +858,11 @@ base class _HashSet extends _SetBase implements HashSet { } } - static bool _isStringElement(var element) { + static bool _isStringElement(element) { return element is String && element != '__proto__'; } - static bool _isNumericElement(var element) { + static bool _isNumericElement(element) { // Only treat unsigned 30-bit integers as numeric elements. This // way, we avoid converting them to strings when we use them as // keys in the JavaScript hash table object. @@ -870,7 +870,7 @@ base class _HashSet extends _SetBase implements HashSet { JS('bool', '(# & #) === #', element, _mask30, element); } - int _computeHashCode(var element) { + int _computeHashCode(element) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic elements like '__proto__'. Another // option would be to throw an exception if the hash code isn't a @@ -878,7 +878,7 @@ base class _HashSet extends _SetBase implements HashSet { return JS('int', '# & #', element.hashCode, _mask30); } - static bool _hasTableEntry(var table, var key) { + static bool _hasTableEntry(table, key) { var entry = JS('var', '#[#]', table, key); // We take care to only store non-null entries in the table, so we // can check if the table has an entry for the given key with a @@ -886,21 +886,21 @@ base class _HashSet extends _SetBase implements HashSet { return entry != null; } - static void _setTableEntry(var table, var key, var value) { + static void _setTableEntry(table, key, value) { assert(value != null); JS('void', '#[#] = #', table, key, value); } - static void _deleteTableEntry(var table, var key) { + static void _deleteTableEntry(table, key) { JS('void', 'delete #[#]', table, key); } - List? _getBucket(var table, var element) { + List? _getBucket(table, element) { var hash = _computeHashCode(element); return JS('var', '#[#]', table, hash); } - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -927,14 +927,14 @@ base class _IdentityHashSet extends _HashSet { Set _newSet() => _IdentityHashSet(); Set _newSimilarSet() => _IdentityHashSet(); - int _computeHashCode(var key) { + int _computeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', identityHashCode(key), _mask30); } - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -954,7 +954,7 @@ base class _CustomHashSet extends _HashSet { Set _newSet() => _CustomHashSet(_equality, _hasher, _validKey); Set _newSimilarSet() => _HashSet(); - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -963,7 +963,7 @@ base class _CustomHashSet extends _HashSet { return -1; } - int _computeHashCode(var element) { + int _computeHashCode(element) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic elements like '__proto__'. Another // option would be to throw an exception if the hash code isn't a @@ -1265,14 +1265,14 @@ base class _LinkedHashSet extends _SetBase implements LinkedHashSet { } } - bool _addHashTableEntry(var table, E element) { + bool _addHashTableEntry(table, E element) { _LinkedHashSetCell? cell = _getTableEntry(table, element); if (cell != null) return false; _setTableEntry(table, element, _newLinkedCell(element)); return true; } - bool _removeHashTableEntry(var table, Object? element) { + bool _removeHashTableEntry(table, Object? element) { if (table == null) return false; _LinkedHashSetCell? cell = _getTableEntry(table, element); if (cell == null) return false; @@ -1323,11 +1323,11 @@ base class _LinkedHashSet extends _SetBase implements LinkedHashSet { _modified(); } - static bool _isStringElement(var element) { + static bool _isStringElement(element) { return element is String && element != '__proto__'; } - static bool _isNumericElement(var element) { + static bool _isNumericElement(element) { // Only treat unsigned 30-bit integers as numeric elements. This // way, we avoid converting them to strings when we use them as // keys in the JavaScript hash table object. @@ -1335,7 +1335,7 @@ base class _LinkedHashSet extends _SetBase implements LinkedHashSet { JS('bool', '(# & #) === #', element, _mask30, element); } - int _computeHashCode(var element) { + int _computeHashCode(element) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic elements like '__proto__'. Another // option would be to throw an exception if the hash code isn't a @@ -1343,25 +1343,25 @@ base class _LinkedHashSet extends _SetBase implements LinkedHashSet { return JS('int', '# & #', element.hashCode, _mask30); } - static _getTableEntry(var table, var key) { + static _getTableEntry(table, key) { return JS('var', '#[#]', table, key); } - static void _setTableEntry(var table, var key, var value) { + static void _setTableEntry(table, key, value) { assert(value != null); JS('void', '#[#] = #', table, key, value); } - static void _deleteTableEntry(var table, var key) { + static void _deleteTableEntry(table, key) { JS('void', 'delete #[#]', table, key); } - List? _getBucket(var table, var element) { + List? _getBucket(table, element) { var hash = _computeHashCode(element); return JS('var', '#[#]', table, hash); } - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -1389,14 +1389,14 @@ base class _LinkedIdentityHashSet extends _LinkedHashSet { Set _newSet() => _LinkedIdentityHashSet(); Set _newSimilarSet() => _LinkedIdentityHashSet(); - int _computeHashCode(var key) { + int _computeHashCode(key) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic keys like '__proto__'. Another option // would be to throw an exception if the hash code isn't a number. return JS('int', '# & #', identityHashCode(key), _mask30); } - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -1420,7 +1420,7 @@ base class _LinkedCustomHashSet extends _LinkedHashSet { Set _newSet() => _LinkedCustomHashSet(_equality, _hasher, _validKey); Set _newSimilarSet() => _LinkedHashSet(); - int _findBucketIndex(var bucket, var element) { + int _findBucketIndex(bucket, element) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -1430,7 +1430,7 @@ base class _LinkedCustomHashSet extends _LinkedHashSet { return -1; } - int _computeHashCode(var element) { + int _computeHashCode(element) { // We force the hash codes to be unsigned 30-bit integers to avoid // issues with problematic elements like '__proto__'. Another // option would be to throw an exception if the hash code isn't a diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart index cc3be729232..39c106db01b 100644 --- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart @@ -657,7 +657,7 @@ class NoSuchMethodError { } var namedArguments = _namedArguments; if (namedArguments != null) { - namedArguments.forEach((Symbol key, var value) { + namedArguments.forEach((Symbol key, value) { sb.write(comma); sb.write(_symbolToString(key)); sb.write(": "); diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart index 4f7c3e937ee..7ee40501d25 100644 --- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/io_patch.dart @@ -199,7 +199,7 @@ class _File { @patch class _Namespace { @patch - static void _setupNamespace(var namespace) { + static void _setupNamespace(namespace) { throw UnsupportedError("_Namespace"); } diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart index 2ac0732d045..192971d2c9d 100644 --- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart @@ -58,7 +58,7 @@ class Isolate { static Future spawnUri( Uri uri, List args, - var message, { + message, { bool paused = false, SendPort? onExit, SendPort? onError, diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart index 5a5c62d945a..0fef3cec02a 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart @@ -135,7 +135,7 @@ getType(int index) { /// JS engine. requiresPreamble() {} -bool isJsIndexable(var object, var record) { +bool isJsIndexable(object, record) { if (record != null) { var result = dispatchRecordIndexability(record); if (result != null) return result; @@ -2227,22 +2227,22 @@ copyAndJsonifyProperties(from, Map to) { } /// Returns the property [index] of the JavaScript array [array]. -getIndex(var array, int index) { +getIndex(array, int index) { return JS('var', r'#[#]', array, index); } /// Returns the length of the JavaScript array [array]. -int getLength(var array) { +int getLength(array) { return JS('int', r'#.length', array); } _invokeClosure( Function closure, int numberOfArguments, - var arg1, - var arg2, - var arg3, - var arg4, + arg1, + arg2, + arg3, + arg4, ) { switch (numberOfArguments) { case 0: @@ -3038,11 +3038,11 @@ final class BoundClosure extends TearOffClosure { } } -bool jsHasOwnProperty(var jsObject, String property) { +bool jsHasOwnProperty(jsObject, String property) { return JS('bool', r'#.hasOwnProperty(#)', jsObject, property); } -jsPropertyAccess(var jsObject, String property) { +jsPropertyAccess(jsObject, String property) { return JS('var', r'#[#]', jsObject, property); } diff --git a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart index c19a5cd5fbf..00d5afd94a0 100644 --- a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart +++ b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart @@ -198,7 +198,7 @@ class JsLinkedHashMap extends MapBase } } - void _addHashTableEntry(var table, K key, V value) { + void _addHashTableEntry(table, K key, V value) { LinkedHashMapCell? cell = _getTableCell(table, key); if (cell == null) { _setTableEntry(table, key, _newLinkedCell(key, value)); @@ -207,7 +207,7 @@ class JsLinkedHashMap extends MapBase } } - V? _removeHashTableEntry(var table, Object? key) { + V? _removeHashTableEntry(table, Object? key) { if (table == null) return null; LinkedHashMapCell? cell = _getTableCell(table, key); if (cell == null) return null; @@ -259,27 +259,27 @@ class JsLinkedHashMap extends MapBase _modified(); } - static bool _isStringKey(var key) { + static bool _isStringKey(key) { return key is String; } - static bool _isNumericKey(var key) { + static bool _isNumericKey(key) { // Only treat unsigned 30-bit integers as numeric keys. This way, // we avoid converting them to strings when we use them as keys in // the JavaScript hash table object. return key is num && JS('bool', '(# & 0x3fffffff) === #', key, key); } - int internalComputeHashCode(var key) { + int internalComputeHashCode(key) { return bucketHashMask & key.hashCode; } - List? _getBucket(var table, var key) { + List? _getBucket(table, key) { var hash = internalComputeHashCode(key); return _getTableBucket(table, hash); } - int internalFindBucketIndex(var bucket, var key) { + int internalFindBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -291,24 +291,24 @@ class JsLinkedHashMap extends MapBase String toString() => MapBase.mapToString(this); - LinkedHashMapCell? _getTableCell(var table, var key) { + LinkedHashMapCell? _getTableCell(table, key) { return JS('var', '#[#]', table, key); } - List? _getTableBucket(var table, var key) { + List? _getTableBucket(table, key) { return JS('var', '#[#]', table, key); } - void _setTableEntry(var table, var key, var value) { + void _setTableEntry(table, key, value) { assert(value != null); JS('void', '#[#] = #', table, key, value); } - void _deleteTableEntry(var table, var key) { + void _deleteTableEntry(table, key) { JS('void', 'delete #[#]', table, key); } - bool _containsTableEntry(var table, var key) { + bool _containsTableEntry(table, key) { LinkedHashMapCell? cell = _getTableCell(table, key); return cell != null; } @@ -493,11 +493,11 @@ class LinkedHashMapEntryIterator implements Iterator> { base class JsIdentityLinkedHashMap extends JsLinkedHashMap { JsIdentityLinkedHashMap(); - int internalComputeHashCode(var key) { + int internalComputeHashCode(key) { return JsLinkedHashMap.bucketHashMask & identityHashCode(key); } - int internalFindBucketIndex(var bucket, var key) { + int internalFindBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { @@ -514,11 +514,11 @@ base class JsIdentityLinkedHashMap extends JsLinkedHashMap { base class JsConstantLinkedHashMap extends JsLinkedHashMap { JsConstantLinkedHashMap(); - int internalComputeHashCode(var key) { + int internalComputeHashCode(key) { return JsLinkedHashMap.bucketHashMask & constantHashCode(key); } - int internalFindBucketIndex(var bucket, var key) { + int internalFindBucketIndex(bucket, key) { if (bucket == null) return -1; int length = JS('int', '#.length', bucket); for (int i = 0; i < length; i++) { diff --git a/sdk/lib/_internal/js_runtime/lib/native_helper.dart b/sdk/lib/_internal/js_runtime/lib/native_helper.dart index 6b37fc0d6a4..feaa5a3d8d6 100644 --- a/sdk/lib/_internal/js_runtime/lib/native_helper.dart +++ b/sdk/lib/_internal/js_runtime/lib/native_helper.dart @@ -18,23 +18,23 @@ arrayGet(List array, int index) { return JS('var', '#[#]', array, index); } -void arraySet(List array, int index, var value) { +void arraySet(List array, int index, value) { JS('var', '#[#] = #', array, index, value); } -propertyGet(var object, String property) { +propertyGet(object, String property) { return JS('var', '#[#]', object, property); } -bool callHasOwnProperty(var function, var object, String property) { +bool callHasOwnProperty(function, object, String property) { return JS('bool', '#.call(#, #)', function, object, property); } -void propertySet(var object, String property, var value) { +void propertySet(object, String property, value) { JS('var', '#[#] = #', object, property, value); } -getPropertyFromPrototype(var object, String name) { +getPropertyFromPrototype(object, String name) { return JS('var', 'Object.getPrototypeOf(#)[#]', object, name); } @@ -55,7 +55,7 @@ Function? alternateTagFunction; /// constructor is to be avoided. Initialized by [initHooks]. Function? prototypeForTagFunction; -String toStringForNativeObject(var obj) { +String toStringForNativeObject(obj) { // TODO(sra): Is this code dead? // [getTagFunction] might be uninitialized, but in usual usage, toString has // been called via an interceptor and initialized it. @@ -68,7 +68,7 @@ String toStringForNativeObject(var obj) { int hashCodeForNativeObject(object) => Primitives.objectHashCode(object); /// Sets a JavaScript property on an object. -void defineProperty(var obj, String property, var value) { +void defineProperty(obj, String property, value) { JS( 'void', 'Object.defineProperty(#, #, ' diff --git a/sdk/lib/_internal/vm/bin/namespace_patch.dart b/sdk/lib/_internal/vm/bin/namespace_patch.dart index 7ce21b41609..14adcc0846d 100644 --- a/sdk/lib/_internal/vm/bin/namespace_patch.dart +++ b/sdk/lib/_internal/vm/bin/namespace_patch.dart @@ -10,7 +10,7 @@ base class _NamespaceImpl extends NativeFieldWrapperClass1 _NamespaceImpl._(); @pragma("vm:external-name", "Namespace_Create") - external static _NamespaceImpl _create(_NamespaceImpl namespace, var n); + external static _NamespaceImpl _create(_NamespaceImpl namespace, n); @pragma("vm:external-name", "Namespace_GetPointer") external static int _getPointer(_NamespaceImpl namespace); @pragma("vm:external-name", "Namespace_GetDefault") @@ -19,7 +19,7 @@ base class _NamespaceImpl extends NativeFieldWrapperClass1 // If the platform supports "namespaces", this method is called by the // embedder with the platform-specific namespace information. static _NamespaceImpl? _cachedNamespace = null; - static void _setupNamespace(var namespace) { + static void _setupNamespace(namespace) { _cachedNamespace = _create(_NamespaceImpl._(), namespace); } @@ -40,7 +40,7 @@ base class _NamespaceImpl extends NativeFieldWrapperClass1 class _Namespace { @patch @pragma("vm:entry-point", "call") - static void _setupNamespace(var namespace) { + static void _setupNamespace(namespace) { _NamespaceImpl._setupNamespace(namespace); } diff --git a/sdk/lib/_internal/vm/bin/resident_compiler_utils.dart b/sdk/lib/_internal/vm/bin/resident_compiler_utils.dart index e3208834d4b..6b0967ceb1a 100644 --- a/sdk/lib/_internal/vm/bin/resident_compiler_utils.dart +++ b/sdk/lib/_internal/vm/bin/resident_compiler_utils.dart @@ -16,7 +16,7 @@ String maybeUriToFilename(String maybeUri) { /// Joins [a] and [b] with a backslash if [Platform.isWindows] is true, /// otherwise joins [a] and [b] with a slash. -String joinPathComponents(final String a, final String b) => +String joinPathComponents(String a, String b) => !Platform.isWindows ? '$a/$b' : '$a\\$b'; /// The user's home directory for the current platform, or [null] if it can't be diff --git a/sdk/lib/_internal/vm/bin/vmservice_io.dart b/sdk/lib/_internal/vm/bin/vmservice_io.dart index 88f5b29f9e5..c71e608f51f 100644 --- a/sdk/lib/_internal/vm/bin/vmservice_io.dart +++ b/sdk/lib/_internal/vm/bin/vmservice_io.dart @@ -74,7 +74,7 @@ void _populateResidentCompilerInfoFile( /// was supplied on the command line, the CLI argument should be forwarded as /// the argument to this parameter. If neither option was supplied, the /// argument to this parameter should be [null]. - final String? residentCompilerInfoFilePathArgumentFromCli, + String? residentCompilerInfoFilePathArgumentFromCli, ) { _residentCompilerInfoFile = getResidentCompilerInfoFileConsideringArgsImpl( residentCompilerInfoFilePathArgumentFromCli, diff --git a/sdk/lib/_internal/vm/lib/async_patch.dart b/sdk/lib/_internal/vm/lib/async_patch.dart index 9e1446f30d2..6252ae6baea 100644 --- a/sdk/lib/_internal/vm/lib/async_patch.dart +++ b/sdk/lib/_internal/vm/lib/async_patch.dart @@ -23,7 +23,7 @@ external void _trySetStackTrace(Object error, StackTrace stackTrace); // This function is used when lowering `await for` statements. @pragma('dyn-module:language-impl:callable') -void _asyncStarMoveNextHelper(var stream) { +void _asyncStarMoveNextHelper(stream) { if (stream is! _StreamImpl) { return; } diff --git a/sdk/lib/_internal/vm/lib/errors_patch.dart b/sdk/lib/_internal/vm/lib/errors_patch.dart index 32c7241ae34..d88b0207251 100644 --- a/sdk/lib/_internal/vm/lib/errors_patch.dart +++ b/sdk/lib/_internal/vm/lib/errors_patch.dart @@ -274,7 +274,7 @@ class NoSuchMethodError { } var namedArguments = localInvocation.namedArguments; if (namedArguments != null) { - namedArguments.forEach((Symbol key, var value) { + namedArguments.forEach((Symbol key, value) { if (argumentCount > 0) { argumentsBuf.write(", "); } diff --git a/sdk/lib/_internal/vm/lib/integers.dart b/sdk/lib/_internal/vm/lib/integers.dart index af479437327..ad9a38f8646 100644 --- a/sdk/lib/_internal/vm/lib/integers.dart +++ b/sdk/lib/_internal/vm/lib/integers.dart @@ -597,7 +597,7 @@ final class _Smi extends _IntegerImplementation { // Find the number of decimal digits in a positive smi. // Never called with numbers < 100. These are handled before calling. - static int _positiveBase10Length(var smi) { + static int _positiveBase10Length(smi) { // A positive smi has length <= 19 if 63-bit, <=10 if 31-bit. // Avoid comparing a 31-bit smi to a non-smi. if (smi < 1000) return 3; @@ -658,7 +658,7 @@ final class _Smi extends _IntegerImplementation { // Find the number of decimal digits in a negative smi. // Never called with numbers > -100. These are handled before calling. - static int _negativeBase10Length(var negSmi) { + static int _negativeBase10Length(negSmi) { // A negative smi has length <= 19 if 63-bit, <=10 if 31-bit. // Avoid comparing a 31-bit smi to a non-smi. if (negSmi > -1000) return 3; diff --git a/sdk/lib/_internal/vm/lib/isolate_patch.dart b/sdk/lib/_internal/vm/lib/isolate_patch.dart index 08ac14d1eb4..aa15d0ed2e6 100644 --- a/sdk/lib/_internal/vm/lib/isolate_patch.dart +++ b/sdk/lib/_internal/vm/lib/isolate_patch.dart @@ -82,7 +82,7 @@ final class _ReceivePortImpl extends Stream implements ReceivePort { } StreamSubscription listen( - void onData(var message)?, { + void onData(message)?, { Function? onError, void onDone()?, bool? cancelOnError, @@ -156,7 +156,7 @@ final class _RawReceivePort implements RawReceivePort { @pragma("vm:external-name", "RawReceivePort_getSendPort") external SendPort get sendPort; - bool operator ==(var other) { + bool operator ==(other) { return (other is _RawReceivePort) && (this._get_id() == other._get_id()); } @@ -182,7 +182,7 @@ final class _RawReceivePort implements RawReceivePort { // Called from the VM to dispatch a message. @pragma("vm:entry-point", "call") - static _handleMessage(int id, var message) { + static _handleMessage(int id, message) { final Function? handler = _portMap[id]?._handler; if (handler == null) { return null; @@ -236,11 +236,11 @@ final class _SendPort implements SendPort { /*--- public interface ---*/ @pragma("vm:entry-point", "call") - void send(var message) { + void send(message) { _sendInternal(message); } - bool operator ==(var other) { + bool operator ==(other) { return (other is _SendPort) && (this._get_id() == other._get_id()); } @@ -256,7 +256,7 @@ final class _SendPort implements SendPort { // Forward the implementation of sending messages to the VM. @pragma("vm:external-name", "SendPort_sendInternal_") - external void _sendInternal(var message); + external void _sendInternal(message); } typedef _UnaryFunction(Never args); @@ -421,7 +421,7 @@ final class Isolate { SendPort readyPort, String uri, Function topLevelFunction, - var message, + message, bool paused, bool errorsAreFatal, SendPort? onExit, @@ -434,7 +434,7 @@ final class Isolate { static Future spawnUri( Uri uri, List args, - var message, { + message, { bool paused = false, SendPort? onExit, SendPort? onError, @@ -576,7 +576,7 @@ final class Isolate { SendPort readyPort, String uri, List args, - var message, + message, bool paused, SendPort? onExit, SendPort? onError, diff --git a/sdk/lib/_internal/vm/lib/string_patch.dart b/sdk/lib/_internal/vm/lib/string_patch.dart index 5af24be8e3f..a9d34e7e3e4 100644 --- a/sdk/lib/_internal/vm/lib/string_patch.dart +++ b/sdk/lib/_internal/vm/lib/string_patch.dart @@ -879,7 +879,7 @@ abstract final class _StringBase implements String { @pragma("vm:recognized", "other") @pragma("vm:entry-point", "call") @pragma("vm:never-inline") - static String _interpolate(final List values) { + static String _interpolate(List values) { final numValues = values.length; int totalLength = 0; int i = 0; diff --git a/sdk/lib/_internal/wasm/lib/boxed_double.dart b/sdk/lib/_internal/wasm/lib/boxed_double.dart index 2ef0d1f4289..a4cddbb1cdf 100644 --- a/sdk/lib/_internal/wasm/lib/boxed_double.dart +++ b/sdk/lib/_internal/wasm/lib/boxed_double.dart @@ -261,7 +261,7 @@ final class BoxedDouble implements double { return _roundToDouble(this); } - static double _roundToDouble(final double d) { + static double _roundToDouble(double d) { final int bits = doubleToIntBits(d); final int exponent = (bits >> _mantissaBits) & ((1 << _exponentBits) - 1); diff --git a/sdk/lib/_internal/wasm/lib/errors_patch.dart b/sdk/lib/_internal/wasm/lib/errors_patch.dart index d0d77c12f80..18fb46998c5 100644 --- a/sdk/lib/_internal/wasm/lib/errors_patch.dart +++ b/sdk/lib/_internal/wasm/lib/errors_patch.dart @@ -212,7 +212,7 @@ class NoSuchMethodError { } Map? namedArguments = _namedArguments; if (namedArguments != null) { - namedArguments.forEach((Symbol key, var value) { + namedArguments.forEach((Symbol key, value) { sb.write(comma); sb.write(_symbolToString(key)); sb.write(": "); diff --git a/sdk/lib/_internal/wasm/lib/io_patch.dart b/sdk/lib/_internal/wasm/lib/io_patch.dart index 0810157d67d..91c41636be8 100644 --- a/sdk/lib/_internal/wasm/lib/io_patch.dart +++ b/sdk/lib/_internal/wasm/lib/io_patch.dart @@ -199,7 +199,7 @@ class _File { @patch class _Namespace { @patch - static void _setupNamespace(var namespace) { + static void _setupNamespace(namespace) { throw UnsupportedError("_Namespace"); } diff --git a/sdk/lib/_internal/wasm/lib/isolate_patch.dart b/sdk/lib/_internal/wasm/lib/isolate_patch.dart index 8d0b3fb0f59..ce678017708 100644 --- a/sdk/lib/_internal/wasm/lib/isolate_patch.dart +++ b/sdk/lib/_internal/wasm/lib/isolate_patch.dart @@ -57,7 +57,7 @@ class Isolate { static Future spawnUri( Uri uri, List args, - var message, { + message, { bool paused = false, SendPort? onExit, SendPort? onError, diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart index 65256ced0e4..9bb5a9a9534 100644 --- a/sdk/lib/async/stream_impl.dart +++ b/sdk/lib/async/stream_impl.dart @@ -1030,7 +1030,7 @@ class _StreamIterator implements StreamIterator { bool _hasValue = false; @pragma('dyn-module:language-impl:callable') - _StreamIterator(final Stream stream) + _StreamIterator(Stream stream) : _stateData = checkNotNullable(stream, "stream"); T get current { diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart index 5500c746d09..9c88ec5eb86 100644 --- a/sdk/lib/core/errors.dart +++ b/sdk/lib/core/errors.dart @@ -252,7 +252,7 @@ class RangeError extends ArgumentError { // It currently isn't in all cases. /// Create a new [RangeError] with the given [message]. @pragma("vm:entry-point") - RangeError(var message) : start = null, end = null, super(message); + RangeError(message) : start = null, end = null, super(message); /// Create a new [RangeError] with a message for the given [value]. /// diff --git a/sdk/lib/core/exceptions.dart b/sdk/lib/core/exceptions.dart index fb3e6346130..6f317d6259b 100644 --- a/sdk/lib/core/exceptions.dart +++ b/sdk/lib/core/exceptions.dart @@ -21,7 +21,7 @@ part of "dart:core"; /// and its subclasses. @pragma('flutter:keep-to-string-in-subtypes') abstract interface class Exception { - factory Exception([var message]) => _Exception(message); + factory Exception([message]) => _Exception(message); } /// Default implementation of [Exception] which carries a message. diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index c3b56fb5940..ecffe482236 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -36999,7 +36999,7 @@ abstract class WindowBase implements EventTarget { * from WHATWG. */ void postMessage( - var message, + message, String targetOrigin, [ List? messagePorts, ]); @@ -39853,7 +39853,7 @@ class _KeyboardEventHandler extends EventStreamProvider { /** Determine if caps lock is one of the currently depressed keys. */ bool get _capsLockOn => - _keyDownList.any((var element) => element.keyCode == KeyCode.CAPS_LOCK); + _keyDownList.any((element) => element.keyCode == KeyCode.CAPS_LOCK); /** * Given the previously recorded keydown key codes, see if we can determine @@ -40092,7 +40092,7 @@ class _KeyboardEventHandler extends EventStreamProvider { // keyCode/which for non printable keys. e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier]!; } - e._shadowAltKey = _keyDownList.any((var element) => element.altKey); + e._shadowAltKey = _keyDownList.any((element) => element.altKey); _stream.add(e); } @@ -41114,7 +41114,7 @@ class _DOMWindowCrossFrame implements WindowBase { // Methods. void close() => JS('void', '#.close()', _window); - void postMessage(var message, String targetOrigin, [List? messagePorts]) { + void postMessage(message, String targetOrigin, [List? messagePorts]) { if (messagePorts == null) { JS( 'void', diff --git a/sdk/lib/io/namespace_impl.dart b/sdk/lib/io/namespace_impl.dart index 99b6add45fe..06c4d003010 100644 --- a/sdk/lib/io/namespace_impl.dart +++ b/sdk/lib/io/namespace_impl.dart @@ -20,5 +20,5 @@ abstract class _Namespace { // relative to the process's current working directory and absolute paths will // be left relative to the file system root. @pragma("vm:entry-point") - external static void _setupNamespace(var namespace); + external static void _setupNamespace(namespace); } diff --git a/sdk/lib/io/network_profiling.dart b/sdk/lib/io/network_profiling.dart index a1b2a4a85a0..270ddd5a897 100644 --- a/sdk/lib/io/network_profiling.dart +++ b/sdk/lib/io/network_profiling.dart @@ -99,7 +99,7 @@ abstract class _NetworkProfiling { ...HttpProfiler.serializeHttpProfileRequests(updatedSince), ...getHttpClientProfilingData() .where( - (final Map p) => + (Map p) => updatedSince == null || (p['_lastUpdateTime'] as int) >= updatedSince, ) diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart index 03b963b5056..8e4cb2b6e6a 100644 --- a/sdk/lib/isolate/isolate.dart +++ b/sdk/lib/isolate/isolate.dart @@ -546,7 +546,7 @@ final class Isolate { external static Future spawnUri( Uri uri, List args, - var message, { + message, { bool paused = false, SendPort? onExit, SendPort? onError, @@ -906,7 +906,7 @@ abstract interface class SendPort implements Capability { /// Tests whether [other] is a [SendPort] pointing to the same /// [ReceivePort] as this one. - bool operator ==(var other); + bool operator ==(other); /// A hash code for this send port that is consistent with the == operator. int get hashCode; @@ -955,7 +955,7 @@ abstract interface class ReceivePort implements Stream { /// The [onDone] handler will be called when the stream closes. /// The stream closes when [close] is called. StreamSubscription listen( - void onData(var message)?, { + void onData(message)?, { Function? onError, void onDone()?, bool? cancelOnError, diff --git a/tools/dom/src/CrossFrameTypes.dart b/tools/dom/src/CrossFrameTypes.dart index 72113cff0f4..d1e204bc316 100644 --- a/tools/dom/src/CrossFrameTypes.dart +++ b/tools/dom/src/CrossFrameTypes.dart @@ -144,7 +144,7 @@ abstract class WindowBase implements EventTarget { * * [Cross-document messaging](https://html.spec.whatwg.org/multipage/comms.html#web-messaging) * from WHATWG. */ - void postMessage(var message, String targetOrigin, + void postMessage(message, String targetOrigin, [List? messagePorts]); } diff --git a/tools/dom/src/KeyboardEventStream.dart b/tools/dom/src/KeyboardEventStream.dart index db3b1cf21ef..2812d58c0d8 100644 --- a/tools/dom/src/KeyboardEventStream.dart +++ b/tools/dom/src/KeyboardEventStream.dart @@ -100,7 +100,7 @@ class _KeyboardEventHandler extends EventStreamProvider { /** Determine if caps lock is one of the currently depressed keys. */ bool get _capsLockOn => - _keyDownList.any((var element) => element.keyCode == KeyCode.CAPS_LOCK); + _keyDownList.any((element) => element.keyCode == KeyCode.CAPS_LOCK); /** * Given the previously recorded keydown key codes, see if we can determine @@ -339,7 +339,7 @@ class _KeyboardEventHandler extends EventStreamProvider { // keyCode/which for non printable keys. e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier]!; } - e._shadowAltKey = _keyDownList.any((var element) => element.altKey); + e._shadowAltKey = _keyDownList.any((element) => element.altKey); _stream.add(e); } diff --git a/tools/dom/src/_chrome/utils.dart b/tools/dom/src/_chrome/utils.dart index a06085d14e9..6c650564238 100644 --- a/tools/dom/src/_chrome/utils.dart +++ b/tools/dom/src/_chrome/utils.dart @@ -70,7 +70,7 @@ List _convertListArgument(List argument) { * * Cannot be used for functions. */ -Object convertArgument(var argument) { +Object convertArgument(argument) { if (argument == null) return argument; if (argument is num || argument is String || argument is bool) diff --git a/tools/dom/src/dart2js_DOMImplementation.dart b/tools/dom/src/dart2js_DOMImplementation.dart index a4cf1aca8c2..dd29369a163 100644 --- a/tools/dom/src/dart2js_DOMImplementation.dart +++ b/tools/dom/src/dart2js_DOMImplementation.dart @@ -42,7 +42,7 @@ class _DOMWindowCrossFrame implements WindowBase { // Methods. void close() => JS('void', '#.close()', _window); - void postMessage(var message, String targetOrigin, [List? messagePorts]) { + void postMessage(message, String targetOrigin, [List? messagePorts]) { if (messagePorts == null) { JS('void', '#.postMessage(#,#)', _window, convertDartToNative_SerializedScriptValue(message), targetOrigin); diff --git a/utils/compiler/create_snapshot_entry.dart b/utils/compiler/create_snapshot_entry.dart index b3b7ab3c6b5..7d1c6c5ca02 100644 --- a/utils/compiler/create_snapshot_entry.dart +++ b/utils/compiler/create_snapshot_entry.dart @@ -9,7 +9,7 @@ import 'dart:io'; import 'dart:async'; -Future getVersion(var rootPath, bool noGitHash) { +Future getVersion(rootPath, bool noGitHash) { var printVersionScript = rootPath.resolve("tools/make_version.py"); var args = [ printVersionScript.toFilePath(), @@ -25,7 +25,7 @@ Future getVersion(var rootPath, bool noGitHash) { }); } -Future getDart2jsSnapshotGenerationFile(var rootPath, bool noGitHash) { +Future getDart2jsSnapshotGenerationFile(rootPath, bool noGitHash) { return getVersion(rootPath, noGitHash).then((version) { var snapshotGenerationText = """