mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:15:07 +00:00
LibJS: Simplify Cell::initialize()
Remove the Interpreter& argument and pass only GlobalObject&. We can find everything we need via the global object anyway.
This commit is contained in:
parent
299824de73
commit
aaf6014ae1
82 changed files with 161 additions and 160 deletions
|
@ -365,7 +365,7 @@ static void generate_header(const IDL::Interface& interface)
|
|||
out() << " JS_OBJECT(" << wrapper_class << ", " << wrapper_base_class << ");";
|
||||
out() << "public:";
|
||||
out() << " " << wrapper_class << "(JS::GlobalObject&, " << interface.name << "&);";
|
||||
out() << " virtual void initialize(JS::Interpreter&, JS::GlobalObject&) override;";
|
||||
out() << " virtual void initialize(JS::GlobalObject&) override;";
|
||||
out() << " virtual ~" << wrapper_class << "() override;";
|
||||
|
||||
if (wrapper_base_class == "Wrapper") {
|
||||
|
@ -444,10 +444,10 @@ void generate_implementation(const IDL::Interface& interface)
|
|||
out() << "}";
|
||||
|
||||
// Implementation: Wrapper initialize()
|
||||
out() << "void " << wrapper_class << "::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object)";
|
||||
out() << "void " << wrapper_class << "::initialize(JS::GlobalObject& global_object)";
|
||||
out() << "{";
|
||||
out() << " [[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable | JS::Attribute::Configurable;";
|
||||
out() << " " << wrapper_base_class << "::initialize(interpreter, global_object);";
|
||||
out() << " " << wrapper_base_class << "::initialize(global_object);";
|
||||
|
||||
for (auto& attribute : interface.attributes) {
|
||||
out() << " define_native_property(\"" << attribute.name << "\", " << attribute.getter_callback_name << ", " << (attribute.readonly ? "nullptr" : attribute.setter_callback_name) << ", default_attributes);";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue