LibWeb: Account for LegacyNamespace attribute in constructor generator

When playing games with cross-realm construction, we need to make sure
that any calls to ensure_web_prototype for LegacyNamespace objects use
the correctly namespaced prototype name.
This commit is contained in:
Andrew Kaster 2025-04-23 03:07:14 -06:00 committed by Jelle Raaijmakers
parent 79352ad725
commit 7b0c2da14f
Notes: github-actions[bot] 2025-04-23 12:32:15 +00:00

View file

@ -2771,7 +2771,7 @@ JS::ThrowCompletionOr<GC::Ref<JS::Object>> @constructor_class@::construct@overlo
// 2. Set prototype to the interface prototype object for interface in targetRealm.
VERIFY(target_realm);
prototype = &Bindings::ensure_web_prototype<@prototype_class@>(*target_realm, "@name@"_fly_string);
prototype = &Bindings::ensure_web_prototype<@prototype_class@>(*target_realm, "@namespaced_name@"_fly_string);
}
// 4. Let instance be MakeBasicObject( « [[Prototype]], [[Extensible]], [[Realm]], [[PrimaryInterface]] »).