mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
LibJS+Spreadsheet: Use js_string(VM&, ...) overload more
This commit is contained in:
parent
bac3c2cf6d
commit
312946059b
21 changed files with 24 additions and 24 deletions
|
@ -1027,14 +1027,14 @@ void Object::define_native_accessor(PropertyName const& property_name, Function<
|
|||
auto name = String::formatted("get {}", formatted_property_name);
|
||||
getter_function = NativeFunction::create(global_object(), name, move(getter));
|
||||
getter_function->define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
getter_function->define_direct_property(vm.names.name, js_string(vm.heap(), name), Attribute::Configurable);
|
||||
getter_function->define_direct_property(vm.names.name, js_string(vm, name), Attribute::Configurable);
|
||||
}
|
||||
FunctionObject* setter_function = nullptr;
|
||||
if (setter) {
|
||||
auto name = String::formatted("set {}", formatted_property_name);
|
||||
setter_function = NativeFunction::create(global_object(), name, move(setter));
|
||||
setter_function->define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
setter_function->define_direct_property(vm.names.name, js_string(vm.heap(), name), Attribute::Configurable);
|
||||
setter_function->define_direct_property(vm.names.name, js_string(vm, name), Attribute::Configurable);
|
||||
}
|
||||
return define_direct_accessor(property_name, getter_function, setter_function, attribute);
|
||||
}
|
||||
|
@ -1088,7 +1088,7 @@ void Object::define_native_function(PropertyName const& property_name, Function<
|
|||
}
|
||||
auto* function = NativeFunction::create(global_object(), function_name, move(native_function));
|
||||
function->define_direct_property(vm.names.length, Value(length), Attribute::Configurable);
|
||||
function->define_direct_property(vm.names.name, js_string(vm.heap(), function_name), Attribute::Configurable);
|
||||
function->define_direct_property(vm.names.name, js_string(vm, function_name), Attribute::Configurable);
|
||||
define_direct_property(property_name, function, attribute);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue