LibWeb: Make DOMExceptionPrototype's prototype %Error.prototype%

As mandated in the WebIDL spec:
https://webidl.spec.whatwg.org/#js-DOMException-specialness
This commit is contained in:
Andrew Kaster 2024-03-20 06:42:35 -06:00 committed by Tim Flynn
parent 378fa09a5a
commit 6783a524d0
Notes: sideshowbarker 2024-07-17 08:45:34 +09:00

View File

@ -2741,7 +2741,14 @@ void @class_name@::initialize(JS::Realm& realm)
)~~~");
if (interface.prototype_base_class == "ObjectPrototype") {
if (interface.name == "DOMException"sv) {
generator.append(R"~~~(
set_prototype(realm.intrinsics().error_prototype());
)~~~");
}
else if (interface.prototype_base_class == "ObjectPrototype") {
generator.append(R"~~~(
set_prototype(realm.intrinsics().object_prototype());