- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
microsoft/TypeScript-DOM-lib-generator
#1944Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
⚙ Compilation target
ESNext or any
⚙ Library
ES2024 or newer
Missing / Incorrect Definition
typeAllowSharedBufferSource=ArrayBuffer|ArrayBufferView;should be
typeAllowSharedBufferSource=ArrayBuffer|SharedArrayBuffer|ArrayBufferView;or simply
typeAllowSharedBufferSource=BufferSource|SharedArrayBufferSample Code
// Before lib=ES2024, this works, though it seems like it shouldn't.constx: AllowSharedBufferSource=newSharedArrayBuffer(4);// The reason is that SharedArrayBuffer is structurally a subtype of ArrayBuffer:consty: ArrayBuffer=newSharedArrayBuffer(4);// However when you switch to lib=ES2024+, it (correctly) doesn't work anymore, because// ArrayBuffer gained some properties that SharedArrayBuffer doesn't have.Error (playground link):
Type 'SharedArrayBuffer' is not assignable to type 'AllowSharedBufferSource'. Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength Documentation Link
https://webidl.spec.whatwg.org/#AllowSharedBufferSource
WebIDL:
typedef (ArrayBuffer or SharedArrayBuffer or [AllowShared] ArrayBufferView) AllowSharedBufferSource;Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.