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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arai-a
Copy link

@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
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.

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