mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
LibWeb: Make functions and attributes in bindings writable
This allows overwriting of for example EventTarget.prototype.addEventListener as css3test does.
This commit is contained in:
parent
7a56ca1250
commit
c5c32ad274
1 changed files with 6 additions and 1 deletions
|
@ -1307,6 +1307,8 @@ namespace Web::Bindings {
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Currently almost everything gets default_attributes but it should be configurable per attribute.
|
||||||
|
// See the spec links for details
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,10 +1319,11 @@ namespace Web::Bindings {
|
||||||
void @prototype_class@::initialize(JS::GlobalObject& global_object)
|
void @prototype_class@::initialize(JS::GlobalObject& global_object)
|
||||||
{
|
{
|
||||||
[[maybe_unused]] auto& vm = this->vm();
|
[[maybe_unused]] auto& vm = this->vm();
|
||||||
[[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable | JS::Attribute::Configurable;
|
[[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable | JS::Attribute::Configurable | JS::Attribute::Writable;
|
||||||
|
|
||||||
)~~~");
|
)~~~");
|
||||||
|
|
||||||
|
// https://heycam.github.io/webidl/#es-attributes
|
||||||
for (auto& attribute : interface.attributes) {
|
for (auto& attribute : interface.attributes) {
|
||||||
auto attribute_generator = generator.fork();
|
auto attribute_generator = generator.fork();
|
||||||
attribute_generator.set("attribute.name", attribute.name);
|
attribute_generator.set("attribute.name", attribute.name);
|
||||||
|
@ -1336,6 +1339,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://heycam.github.io/webidl/#es-constants
|
||||||
for (auto& constant : interface.constants) {
|
for (auto& constant : interface.constants) {
|
||||||
auto constant_generator = generator.fork();
|
auto constant_generator = generator.fork();
|
||||||
constant_generator.set("constant.name", constant.name);
|
constant_generator.set("constant.name", constant.name);
|
||||||
|
@ -1346,6 +1350,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://heycam.github.io/webidl/#es-operations
|
||||||
for (auto& function : interface.functions) {
|
for (auto& function : interface.functions) {
|
||||||
auto function_generator = generator.fork();
|
auto function_generator = generator.fork();
|
||||||
function_generator.set("function.name", function.name);
|
function_generator.set("function.name", function.name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue