Skip to content

Do not throw if the attribute setter is called with no arguments #1498

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
Jul 22, 2025

Conversation

arai-a
Copy link
Contributor

@arai-a arai-a commented Jul 2, 2025

Do not throw if the attribute setter is called with no arguments

This is for #1497 .

This changes the attribute setter not to throw if it's called with no arguments (this can happen only if the setter function is extracted from the property descriptor and directly called), and instead treat it as if undefined is passed.

No browsers had been following the previous behavior, and the updated behavior matches WebKit.


Preview | Diff

@arai-a arai-a requested a review from domenic July 3, 2025 04:24
@arai-a
Copy link
Contributor Author

arai-a commented Jul 3, 2025

Thank you for reviewing!

I have some questions:

  • what should I do for Deno and Node.js ? I'm not sure whether and how they're affected.
  • for wpt, is it okay with landing it as Firefox's patch, which would be automatically merged? or should I directly create a PR to wpt repository and ask for review there?

@annevk
Copy link
Member

annevk commented Jul 3, 2025

@lucacasonato and @jasnell should be able to comment for Deno and Node.

Changing WPT as part of Firefox's workflow is fine. Though ideally the window between the specification change landing and the WPT PR is landing is small.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

LGTM.

I am somewhat doubtful Deno and Node implement the specs so precisely here as to have run into this bug :)

@lucacasonato
Copy link
Member

We do implement it precisely, and do throw when arguments.length is 0, but it seems ok from our side to change this.

@arai-a
Copy link
Contributor Author

arai-a commented Jul 22, 2025

I've checked some Node's WebAPIs, but so far I cannot find any affected cases.
arguments.length is checked by constructors and operations, but not by setters.
So I'll mark it unaffected for now.
Please correct me if I'm wrong.

@arai-a
Copy link
Contributor Author

arai-a commented Jul 22, 2025

Changing WPT as part of Firefox's workflow is fine. Though ideally the window between the specification change landing and the WPT PR is landing is small.

Thanks!
The Firefox's patch stack (https://bugzilla.mozilla.org/show_bug.cgi?id=1974950) is ready to land, and the WPT PR will be created/merged when it's landed.

And now bugs for all affected implementations are filed.
How should we coordinate the landing? The spec PR goes first and then the Firefox patch, with the WPT PR?

@annevk annevk merged commit 909c3fe into whatwg:main Jul 22, 2025
2 checks passed
@annevk
Copy link
Member

annevk commented Jul 22, 2025

Sounds good!

Note that if you have to revert the Firefox patch for some reason, it'd be great if you could keep the WPT coverage intact.

@arai-a
Copy link
Contributor Author

arai-a commented Jul 22, 2025

web-platform-tests/wpt#53894 is created for the WPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants