mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibJS: Add "name" property to functions
This commit is contained in:
parent
d007e8d00f
commit
99be27b4a1
16 changed files with 118 additions and 16 deletions
|
@ -61,6 +61,7 @@ template<typename ConstructorType>
|
|||
void GlobalObject::add_constructor(const FlyString& property_name, ConstructorType*& constructor, Object& prototype)
|
||||
{
|
||||
constructor = heap().allocate<ConstructorType>();
|
||||
constructor->put("name", js_string(heap(), property_name), Attribute::Configurable);
|
||||
prototype.put("constructor", constructor);
|
||||
put(property_name, constructor, Attribute::Writable | Attribute::Configurable);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue