Remove var or final from parameters.

Removed from `benchmarks/`, `runtime/`, `sdk/`, `tools/` and `utils/`.
(Leaving `tests/`, `pkg/` and `third_party/`.)

CoreLibraryReviewExempt: No real change.
Tested: No test changes for no real code changes.
Change-Id: Ieb42441457ca3d0ea4443dd153ee902ea33b28de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480241
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
Lasse R.H. Nielsen
2026-02-13 03:35:34 -08:00
committed by Commit Queue
parent de5639663f
commit 0a88f4ef73
46 changed files with 172 additions and 172 deletions
+1 -1
View File
@@ -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 = <dynamic, dynamic>{};
for (int i = 0; i < size; i++) {
@@ -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<int>);
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<int>);
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<int>);
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<int>);
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<int>);
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<int>);
Expect.equals(12, array.length);
Expect.equals(8, array.elementSizeInBytes);
+9 -9
View File
@@ -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<int>);
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<int>);
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<int>);
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<int>);
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<int>);
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<int>);
Expect.equals(12, array.length);
Expect.equals(8, array.elementSizeInBytes);
@@ -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() {
@@ -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;
}
@@ -166,7 +166,7 @@ final copyableClosures = <dynamic>[
return inner;
}(),
() {
foo(var arg) {
foo(arg) {
return () => arg;
}
@@ -41,7 +41,7 @@ final nonCopyableClosures = <dynamic>[
return inner;
})(),
(() {
foo(var arg) {
foo(arg) {
return () => arg;
}
@@ -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 (
@@ -102,7 +102,7 @@ List<Candidate<ObjectMirror>> candidateReceivers = <Candidate<ObjectMirror>>[];
List<Candidate<InstanceMirror>> candidateArguments =
<Candidate<InstanceMirror>>[];
void addInstance(var instance) {
void addInstance(instance) {
addInstanceMirror(reflect(instance));
}
@@ -64,7 +64,7 @@ throwsIfReceiverMaterializesMoreThanOnce() async {
isolateErrors.close();
}
void receiver(final transferable) {
void receiver(transferable) {
transferable.materialize();
transferable.materialize();
}
+15 -15
View File
@@ -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));
}
@@ -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) \
@@ -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(": ");
@@ -203,7 +203,7 @@ class _File {
@patch
class _Namespace {
@patch
static void _setupNamespace(var namespace) {
static void _setupNamespace(namespace) {
throw UnsupportedError("_Namespace");
}
@@ -46,7 +46,7 @@ class Isolate {
static Future<Isolate> spawnUri(
Uri uri,
List<String> args,
var message, {
message, {
bool paused = false,
SendPort? onExit,
SendPort? onError,
@@ -283,7 +283,7 @@ base class _HashMap<K, V> extends MapBase<K, V> implements HashMap<K, V> {
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<K, V> extends MapBase<K, V> implements HashMap<K, V> {
_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<K, V> extends MapBase<K, V> implements HashMap<K, V> {
}
}
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<K, V> extends MapBase<K, V> implements HashMap<K, V> {
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<K, V> extends MapBase<K, V> implements HashMap<K, V> {
}
}
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<K, V> extends MapBase<K, V> implements HashMap<K, V> {
}
base class _IdentityHashMap<K, V> extends _HashMap<K, V> {
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<K, V> extends _HashMap<K, V> {
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<K, V> extends JsLinkedHashMap<K, V> {
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<E> extends _SetBase<E> implements HashSet<E> {
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<E> extends _SetBase<E> implements HashSet<E> {
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<E> extends _SetBase<E> implements HashSet<E> {
}
}
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<E> extends _SetBase<E> implements HashSet<E> {
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<E> extends _SetBase<E> implements HashSet<E> {
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<E> extends _SetBase<E> implements HashSet<E> {
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<E> extends _HashSet<E> {
Set<E> _newSet() => _IdentityHashSet<E>();
Set<R> _newSimilarSet<R>() => _IdentityHashSet<R>();
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<E> extends _HashSet<E> {
Set<E> _newSet() => _CustomHashSet<E>(_equality, _hasher, _validKey);
Set<R> _newSimilarSet<R>() => _HashSet<R>();
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<E> extends _HashSet<E> {
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<E> extends _SetBase<E> implements LinkedHashSet<E> {
}
}
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<E> extends _SetBase<E> implements LinkedHashSet<E> {
_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<E> extends _SetBase<E> implements LinkedHashSet<E> {
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<E> extends _SetBase<E> implements LinkedHashSet<E> {
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<E> extends _LinkedHashSet<E> {
Set<E> _newSet() => _LinkedIdentityHashSet<E>();
Set<R> _newSimilarSet<R>() => _LinkedIdentityHashSet<R>();
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<E> extends _LinkedHashSet<E> {
Set<E> _newSet() => _LinkedCustomHashSet<E>(_equality, _hasher, _validKey);
Set<R> _newSimilarSet<R>() => _LinkedHashSet<R>();
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<E> extends _LinkedHashSet<E> {
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
@@ -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(": ");
@@ -199,7 +199,7 @@ class _File {
@patch
class _Namespace {
@patch
static void _setupNamespace(var namespace) {
static void _setupNamespace(namespace) {
throw UnsupportedError("_Namespace");
}
@@ -58,7 +58,7 @@ class Isolate {
static Future<Isolate> spawnUri(
Uri uri,
List<String> args,
var message, {
message, {
bool paused = false,
SendPort? onExit,
SendPort? onError,
@@ -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);
}
@@ -198,7 +198,7 @@ class JsLinkedHashMap<K, V> extends MapBase<K, V>
}
}
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<K, V> extends MapBase<K, V>
}
}
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<K, V> extends MapBase<K, V>
_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<LinkedHashMapCell>? _getBucket(var table, var key) {
List<LinkedHashMapCell>? _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<K, V> extends MapBase<K, V>
String toString() => MapBase.mapToString(this);
LinkedHashMapCell? _getTableCell(var table, var key) {
LinkedHashMapCell? _getTableCell(table, key) {
return JS('var', '#[#]', table, key);
}
List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
List<LinkedHashMapCell>? _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<K, V> implements Iterator<MapEntry<K, V>> {
base class JsIdentityLinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
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<K, V> extends JsLinkedHashMap<K, V> {
base class JsConstantLinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
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++) {
@@ -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(#, #, '
@@ -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);
}
@@ -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
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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(", ");
}
+2 -2
View File
@@ -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;
+9 -9
View File
@@ -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<Isolate> spawnUri(
Uri uri,
List<String> args,
var message, {
message, {
bool paused = false,
SendPort? onExit,
SendPort? onError,
@@ -576,7 +576,7 @@ final class Isolate {
SendPort readyPort,
String uri,
List<String> args,
var message,
message,
bool paused,
SendPort? onExit,
SendPort? onError,
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -212,7 +212,7 @@ class NoSuchMethodError {
}
Map<Symbol, dynamic>? 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(": ");
+1 -1
View File
@@ -199,7 +199,7 @@ class _File {
@patch
class _Namespace {
@patch
static void _setupNamespace(var namespace) {
static void _setupNamespace(namespace) {
throw UnsupportedError("_Namespace");
}
@@ -57,7 +57,7 @@ class Isolate {
static Future<Isolate> spawnUri(
Uri uri,
List<String> args,
var message, {
message, {
bool paused = false,
SendPort? onExit,
SendPort? onError,
+1 -1
View File
@@ -1030,7 +1030,7 @@ class _StreamIterator<T> implements StreamIterator<T> {
bool _hasValue = false;
@pragma('dyn-module:language-impl:callable')
_StreamIterator(final Stream<T> stream)
_StreamIterator(Stream<T> stream)
: _stateData = checkNotNullable(stream, "stream");
T get current {
+1 -1
View File
@@ -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].
///
+1 -1
View File
@@ -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.
+4 -4
View File
@@ -36999,7 +36999,7 @@ abstract class WindowBase implements EventTarget {
* from WHATWG.
*/
void postMessage(
var message,
message,
String targetOrigin, [
List<MessagePort>? messagePorts,
]);
@@ -39853,7 +39853,7 @@ class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
/** 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<KeyEvent> {
// 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',
+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -99,7 +99,7 @@ abstract class _NetworkProfiling {
...HttpProfiler.serializeHttpProfileRequests(updatedSince),
...getHttpClientProfilingData()
.where(
(final Map<String, Object?> p) =>
(Map<String, Object?> p) =>
updatedSince == null ||
(p['_lastUpdateTime'] as int) >= updatedSince,
)
+3 -3
View File
@@ -546,7 +546,7 @@ final class Isolate {
external static Future<Isolate> spawnUri(
Uri uri,
List<String> 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<dynamic> {
/// The [onDone] handler will be called when the stream closes.
/// The stream closes when [close] is called.
StreamSubscription<dynamic> listen(
void onData(var message)?, {
void onData(message)?, {
Function? onError,
void onDone()?,
bool? cancelOnError,
+1 -1
View File
@@ -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<MessagePort>? messagePorts]);
}
+2 -2
View File
@@ -100,7 +100,7 @@ class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
/** 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<KeyEvent> {
// 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);
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -9,7 +9,7 @@
import 'dart:io';
import 'dart:async';
Future<String> getVersion(var rootPath, bool noGitHash) {
Future<String> getVersion(rootPath, bool noGitHash) {
var printVersionScript = rootPath.resolve("tools/make_version.py");
var args = <String>[
printVersionScript.toFilePath(),
@@ -25,7 +25,7 @@ Future<String> getVersion(var rootPath, bool noGitHash) {
});
}
Future<String> getDart2jsSnapshotGenerationFile(var rootPath, bool noGitHash) {
Future<String> getDart2jsSnapshotGenerationFile(rootPath, bool noGitHash) {
return getVersion(rootPath, noGitHash).then((version) {
var snapshotGenerationText =
"""