Skip to content

Fixed method signature of Atomics.waitAsync #51602

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 6 commits into from
Dec 2, 2022

Conversation

Eyal-Shalev
Copy link
Contributor

#49204 Added typing for Atomics.waitAsync, but it assumed that the value will be of type BigInt even though (according to MDN) it can also be a number (if the typed array is Int32Array)

@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 20, 2022
@Eyal-Shalev
Copy link
Contributor Author

@microsoft-github-policy-service agree

*/
waitAsync(typedArray: BigInt64Array | Int32Array, index: number, value: bigint, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
Copy link
Contributor

@Josh-Cena Josh-Cena Nov 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the latest proposal, the return value looks like

{ async: false, value: "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "timed-out"> }

But I couldn't test this.

@sandersn sandersn merged commit 5435efb into microsoft:main Dec 2, 2022
@Eyal-Shalev Eyal-Shalev deleted the bugfix/es2022SharedMemory branch December 2, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants