Skip to content

Conversation

@shannonbooth
Copy link
Member

The WebIDL spec requires that attributes marked [LegacyUnforgeable]
share the same getter and setter function objects across all instances
within the same Realm.

Previously, we were creating new JS::NativeFunction wrappers during
every instance initialization, which caused identity checks to fail.
This change moves these functions into Bindings::Intrinsics so they
are created once per Realm and reused.

The WebIDL spec requires that attributes marked [LegacyUnforgeable]
share the same getter and setter function objects across all instances
within the same Realm.

Previously, we were creating new JS::NativeFunction wrappers during
every instance initialization, which caused identity checks to fail.
This change moves these functions into Bindings::Intrinsics so they
are created once per Realm and reused.
@shannonbooth shannonbooth requested a review from Lubrsi January 6, 2026 15:53
@shannonbooth shannonbooth changed the title LibJS: Remove unnecessary return in Object::define_native_accessor LibWeb/Bindings: Ensure identity for [LegacyUnforgeable] attributes Jan 6, 2026
@gmta gmta merged commit f67c15b into LadybirdBrowser:master Jan 8, 2026
11 checks passed
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 this pull request may close these issues.

2 participants