1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:07:35 +00:00

LibWeb: Move IDL attributes and functions to the prototype

Instead of each IDL interface wrapper having its own set of all the
attributes and functions, they are moved to the prototype. This matches
what we already do in LibJS.

Also, this should be spec compliant with the web as well, though there
may be *some* content out there that expects some things to be directly
on the wrapper since that's how things used to work in major browsers
a long time ago. But let's just not worry about that for now.

More work towards #4789
This commit is contained in:
Andreas Kling 2021-01-18 12:02:28 +01:00
parent 630cbc947a
commit fd83918476
2 changed files with 290 additions and 260 deletions

View file

@ -75,7 +75,7 @@ public:
return *it->value;
auto* constructor = heap().allocate<T>(*this, *this);
m_constructors.set(class_name, constructor);
define_property(class_name, constructor, JS::Attribute::Writable | JS::Attribute::Configurable);
define_property(class_name, JS::Value(constructor), JS::Attribute::Writable | JS::Attribute::Configurable);
return *constructor;
}