mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:58:13 +00:00
LibWeb: Return TypeError for [HTMLConstructor] IDL constructors
This matches the spec since there can be no matching custom element definition if we don't support custom elements yet.
This commit is contained in:
parent
6bc6ea8e97
commit
daf421846c
1 changed files with 9 additions and 0 deletions
|
@ -3011,6 +3011,15 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> @constructor_class@::constru
|
|||
generator.set("constructor.length", "0");
|
||||
generator.append(R"~~~(
|
||||
return vm().throw_completion<JS::TypeError>(JS::ErrorType::NotAConstructor, "@namespaced_name@");
|
||||
)~~~");
|
||||
} else if (interface.constructors.find_if([](auto const& x) { return x.extended_attributes.contains("HTMLConstructor"); }) != interface.constructors.end()) {
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor
|
||||
VERIFY(interface.constructors.size() == 1);
|
||||
|
||||
// FIXME: Properly implement HTMLConstructor extended attribute once custom elements are implemented
|
||||
generator.set("constructor.length", "0");
|
||||
generator.append(R"~~~(
|
||||
return vm().throw_completion<JS::TypeError>(JS::ErrorType::NotAConstructor, "@namespaced_name@");
|
||||
)~~~");
|
||||
} else if (interface.constructors.size() == 1) {
|
||||
// Single constructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue