mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
31 lines
1.7 KiB
Plaintext
31 lines
1.7 KiB
Plaintext
es2024SharedMemory.ts(10,34): error TS2550: Property 'waitAsync' does not exist on type 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2024' or later.
|
|
es2024SharedMemory.ts(11,52): error TS2550: Property 'waitAsync' does not exist on type 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2024' or later.
|
|
|
|
|
|
==== es2024SharedMemory.ts (2 errors) ====
|
|
// ES2024 Atomics.waitAsync was included in the ES2022 type file due to a mistake.
|
|
// This test file checks if it fails successfully.
|
|
// https://github.com/microsoft/TypeScript/pull/58573#issuecomment-2119347142
|
|
|
|
const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024);
|
|
const int32 = new Int32Array(sab);
|
|
const sab64 = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 1024);
|
|
const int64 = new BigInt64Array(sab64);
|
|
const waitValue = Atomics.wait(int32, 0, 0);
|
|
const { async, value } = Atomics.waitAsync(int32, 0, 0);
|
|
~~~~~~~~~
|
|
!!! error TS2550: Property 'waitAsync' does not exist on type 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2024' or later.
|
|
const { async: async64, value: value64 } = Atomics.waitAsync(int64, 0, BigInt(0));
|
|
~~~~~~~~~
|
|
!!! error TS2550: Property 'waitAsync' does not exist on type 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2024' or later.
|
|
|
|
const main = async () => {
|
|
if (async) {
|
|
await value;
|
|
}
|
|
if (async64) {
|
|
await value64;
|
|
}
|
|
}
|
|
main();
|
|
|