-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
lib Update Request
Configuration Check
My compilation target is ES2020
and my lib is the default
.
Missing / Incorrect Definition
TypedArray
constructors allows passing (TypedArray, byteOffset, byteLength)
, when only byteOffset
and byteLength
are only used when passing in an ArrayBuffer
Sample Code
const buf = new ArrayBuffer(1024);
const uint8 = new Uint8Array(buf, 16, 128)
// No TS error, even though the `16` and `32` are completely ignored
const subUint8 = new Uint8Array(uint8, 16, 32)
subUint8.byteLength // Oops, this is 128, not 32.
Documentation Link
new Uint8Array(); // new in ES2017
new Uint8Array(length);
new Uint8Array(typedArray);
new Uint8Array(object);
new Uint8Array(buffer);
new Uint8Array(buffer, byteOffset);
new Uint8Array(buffer, byteOffset, length);
deluksic
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this