1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

LibWeb: Add DOM::DOMException class and bindings

This commit is contained in:
Linus Groh 2021-02-19 19:04:41 +01:00 committed by Andreas Kling
parent cc0f5917d3
commit ada71dc71b
6 changed files with 207 additions and 1 deletions

View file

@ -1153,7 +1153,13 @@ namespace Web::Bindings {
{
)~~~");
if (!interface.parent_name.is_empty()) {
if (interface.name == "DOMException") {
// https://heycam.github.io/webidl/#es-DOMException-specialness
// Object.getPrototypeOf(DOMException.prototype) === Error.prototype
generator.append(R"~~~(
set_prototype(global_object.error_prototype());
)~~~");
} else if (!interface.parent_name.is_empty()) {
generator.append(R"~~~(
set_prototype(&static_cast<WindowObject&>(global_object).ensure_web_prototype<@prototype_base_class@>("@parent_name@"));
)~~~");