-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
structuredClone / atob / btoa should throw a TypeError without arguments #41450
Comments
@zloirock, thanks for opening this issue. As far as I understand, these utility methods evolved w/o any standard or official specification. The nearest I can find is the link below. https://html.spec.whatwg.org/multipage/webappapis.html#atob By any chance, would you be able to link a more complete specification or should we derive this specification from current web browser behavior? |
@DerekNonGeneric the same with |
For example, similarly, in the And the error is not specified directly. |
As far as I understand, the WHATWG spec for both of the As for the |
Spec for
Spec for
It looks like Node.js indeed not aligned with the rest of the ecosystem. |
I think this is the part of Web IDL that defines what should happen: https://webidl.spec.whatwg.org/#es-overloads
|
Sure I'll open a quick PR that throws |
I can also add a fix for structuredClone to the PR but I'd rather make a good-first-issue out of it if everyone is OK with it given how straightforward it is maybe? |
@benjamingr, do you think it would be best to add a new If you want me to open a PR to include this |
@DerekNonGeneric I think it's important to understand what That said, if you feel strongly about this feel free to push whatever code you want on that branch or ask that I change it to ERR_MISSING_ARGS both are fine by me :) |
I'll be happy to take the |
|
Oh right, |
Only a subset was fixed in the PR - so reopening. |
PR-URL: nodejs#41651 Fixes: nodejs#41450 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: nodejs#41478 Fixes: nodejs#41450 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Version
17.3.0
Platform
MacOS 12.1
Subsystem
global / buffer
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
^
Additional information
It's an inconsistency with web standards.
The text was updated successfully, but these errors were encountered: