mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibJS: Pass GlobalObject& when constructing an Accessor
This commit is contained in:
parent
1f584911b2
commit
a9e4babdaf
Notes:
sideshowbarker
2024-07-19 05:31:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a9e4babdaf7
3 changed files with 4 additions and 4 deletions
|
@ -1372,7 +1372,7 @@ Value ObjectExpression::execute(Interpreter& interpreter, GlobalObject& global_o
|
|||
accessor = &existing_property.as_accessor();
|
||||
}
|
||||
if (!accessor) {
|
||||
accessor = Accessor::create(interpreter, nullptr, nullptr);
|
||||
accessor = Accessor::create(interpreter, global_object, nullptr, nullptr);
|
||||
object->define_property(key, accessor, Attribute::Configurable | Attribute::Enumerable);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
|
|
@ -35,9 +35,9 @@ namespace JS {
|
|||
|
||||
class Accessor final : public Cell {
|
||||
public:
|
||||
static Accessor* create(Interpreter& interpreter, Function* getter, Function* setter)
|
||||
static Accessor* create(Interpreter& interpreter, GlobalObject& global_object, Function* getter, Function* setter)
|
||||
{
|
||||
return interpreter.heap().allocate<Accessor>(interpreter.global_object(), getter, setter);
|
||||
return interpreter.heap().allocate<Accessor>(global_object, getter, setter);
|
||||
}
|
||||
|
||||
Accessor(Function* getter, Function* setter)
|
||||
|
|
|
@ -388,7 +388,7 @@ bool Object::define_property(const FlyString& property_name, const Object& descr
|
|||
<< "getter=" << getter.to_string_without_side_effects() << ", "
|
||||
<< "setter=" << setter.to_string_without_side_effects() << "}";
|
||||
|
||||
return define_property(property_name, Accessor::create(interpreter(), getter_function, setter_function), attributes, throw_exceptions);
|
||||
return define_property(property_name, Accessor::create(interpreter(), global_object(), getter_function, setter_function), attributes, throw_exceptions);
|
||||
}
|
||||
|
||||
auto value = descriptor.get("value");
|
||||
|
|
Loading…
Add table
Reference in a new issue