You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
url: href setter converts its value before validating the receiver #67344
How often does it reproduce? Is there a required condition?
Always, when calling the href setter with an incompatible receiver and a value whose string conversion has an observable side effect.
What is the expected behavior? Why is that the expected behavior?
TypeError
0
The Web IDL attribute setter algorithm rejects a receiver that does not implement the interface before converting the assigned value to the attribute's IDL type. Therefore, the toString() method must not be called here.
What do you see instead?
TypeError
1
The setter invokes toString() and only then rejects the receiver.
Additional information
Tested regression boundary:
Node.js version
Output
17.0.0
TypeError, 0
19.9.0
TypeError, 0
20.0.0
TypeError, 1
20.20.2, 22.23.4, 24.22.2, 26.13.0
TypeError, 1
The conversion was moved before the private-state access in #47339. The same order is still present in this main-branch source snapshot: the href setter converts the value before accessing this.#context, which rejects an incompatible receiver. The runtime results above are from the listed Node.js releases; the main snapshot was inspected separately.
This regresses the receiver-before-conversion behavior present after #39752.
The same snippet produces the expected output in Chromium 156.0.8078.4, Firefox 157.0 and WebKit 27.2 (Playwright builds), as well as Bun 1.4.4 and Deno 2.9.7.
Activity