Skip to content

Throw an error when mixing BigInt and other types in TypedArray.prototype.set - #1715

Closed
sr5434 wants to merge 1 commit into
quickjs-ng:masterfrom
sr5434:typedarrays
Closed

Throw an error when mixing BigInt and other types in TypedArray.prototype.set#1715
sr5434 wants to merge 1 commit into
quickjs-ng:masterfrom
sr5434:typedarrays

Conversation

@sr5434

@sr5434 sr5434 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

When mixing BigInt and other types in the set method of a TypedArray, a TypeError should be thrown, but instead, undefined is returned by the latest build. Minimal reproducer:

new BigInt64Array(0).set(new Int8Array(0))

QuickJS output:

undefined

NodeJS output:

Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions
    at BigInt64Array.set (<anonymous>)

I patched this issue and added regression tests.

@saghul

saghul commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Isn't this a duplicate of #1694 ?

@sr5434

sr5434 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I forgot I put one up for this

@sr5434 sr5434 closed this Sep 7, 2026
@sr5434
sr5434 deleted the typedarrays branch September 7, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants