Bug Report
🔎 Search Terms
TypedArray, ArrayBuffer, Promise.then, await
🕗 Version & Regression Information
- This changed between versions v3.3.3333 and v3.5.1
⏯ Playground Link
Playground link with relevant code
💻 Code
constarray=newUint8Array(awaitPromise.resolve().then(()=>newArrayBuffer(10)))
🙁 Actual behavior
The above code throws the following error when passing to a TypedArray an awaited ArrayBuffer from a Promise involving a then call
No overload matches this call.
The last overload gave the following error.
Argument of type 'Iterable<number> | ArrayBuffer' is not assignable to parameter of type 'ArrayBuffer'.
Type 'Iterable<number>' is missing the following properties from type 'ArrayBuffer': byteLength, slice, [Symbol.toStringTag]
🙂 Expected behavior
The code should work because the following will not throw an error as the follow examples don't throw an error (also in playground link):
// refactoring the arrayBuffer definition to a separate variable doesn't throw an errorconstarrayBuffer=awaitPromise.resolve().then(()=>newArrayBuffer(10))constarray=newUint8Array(arrayBuffer)
// without the "then" it doesn't throw an errorconstarray=newUint8Array(Promise.resolve(newArrayBuffer(10)))
Bug Report
🔎 Search Terms
TypedArray,ArrayBuffer,Promise.then,await🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The above code throws the following error when passing to a
TypedArrayan awaitedArrayBufferfrom aPromiseinvolving athencall🙂 Expected behavior
The code should work because the following will not throw an error as the follow examples don't throw an error (also in playground link):