Skip to content

Inconsistent signatures for alert() vs prompt()/confirm() #1626

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

Closed
Gaelan opened this issue Oct 4, 2023 · 1 comment · Fixed by #2006
Closed

Inconsistent signatures for alert() vs prompt()/confirm() #1626

Gaelan opened this issue Oct 4, 2023 · 1 comment · Fixed by #2006

Comments

@Gaelan
Copy link

Gaelan commented Oct 4, 2023

Currently, we have:

declare function alert(message?: any): void;
declare function prompt(message?: string, _default?: string): string | null;
declare function confirm(message?: string): boolean;

Presumably alert is typed as taking any because it accepts input of any type and implicitly casts it to a string. However, testing in Chrome, Safari, and Firefox, prompt and confirm both do the same thing.

@saschanaz
Copy link
Contributor

I guess it can be string too, yeah. PRs welcome.

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 a pull request may close this issue.

2 participants