LibJS: Add "name" property to functions

This commit is contained in:
Linus Groh 2020-05-02 19:18:55 +01:00 committed by Andreas Kling
commit 99be27b4a1
Notes: sideshowbarker 2024-07-19 07:02:13 +09:00
16 changed files with 118 additions and 16 deletions

View file

@ -397,6 +397,7 @@ bool Object::put_native_function(const FlyString& property_name, AK::Function<Va
{
auto* function = NativeFunction::create(interpreter(), interpreter().global_object(), property_name, move(native_function));
function->put("length", Value(length), Attribute::Configurable);
function->put("name", js_string(heap(), property_name), Attribute::Configurable);
return put(property_name, function, attributes);
}