Skip to content

Big[U]Int64Array.at returns bigint, not number #46733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/es2022.array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ interface BigInt64Array {
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
at(index: number): bigint | undefined;
}

interface BigUint64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
at(index: number): bigint | undefined;
}
12 changes: 6 additions & 6 deletions tests/baselines/reference/indexAt(target=es2022).types
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ new Float64Array().at(0);
>0 : 0

new BigInt64Array().at(0);
>new BigInt64Array().at(0) : number
>new BigInt64Array().at : (index: number) => number
>new BigInt64Array().at(0) : bigint
>new BigInt64Array().at : (index: number) => bigint
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>at : (index: number) => number
>at : (index: number) => bigint
>0 : 0

new BigUint64Array().at(0);
>new BigUint64Array().at(0) : number
>new BigUint64Array().at : (index: number) => number
>new BigUint64Array().at(0) : bigint
>new BigUint64Array().at : (index: number) => bigint
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>at : (index: number) => number
>at : (index: number) => bigint
>0 : 0

12 changes: 6 additions & 6 deletions tests/baselines/reference/indexAt(target=esnext).types
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ new Float64Array().at(0);
>0 : 0

new BigInt64Array().at(0);
>new BigInt64Array().at(0) : number
>new BigInt64Array().at : (index: number) => number
>new BigInt64Array().at(0) : bigint
>new BigInt64Array().at : (index: number) => bigint
>new BigInt64Array() : BigInt64Array
>BigInt64Array : BigInt64ArrayConstructor
>at : (index: number) => number
>at : (index: number) => bigint
>0 : 0

new BigUint64Array().at(0);
>new BigUint64Array().at(0) : number
>new BigUint64Array().at : (index: number) => number
>new BigUint64Array().at(0) : bigint
>new BigUint64Array().at : (index: number) => bigint
>new BigUint64Array() : BigUint64Array
>BigUint64Array : BigUint64ArrayConstructor
>at : (index: number) => number
>at : (index: number) => bigint
>0 : 0