mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibWeb: Add @@toStringTag own property on wrappers
This makes wrappers stringify to the expected "[object InterfaceName]" instead of just "[object Object]".
This commit is contained in:
parent
427beb97b5
commit
ab4c73746c
1 changed files with 3 additions and 0 deletions
|
@ -1694,6 +1694,9 @@ namespace Web::Bindings {
|
||||||
void @wrapper_class@::initialize(JS::GlobalObject& global_object)
|
void @wrapper_class@::initialize(JS::GlobalObject& global_object)
|
||||||
{
|
{
|
||||||
@wrapper_base_class@::initialize(global_object);
|
@wrapper_base_class@::initialize(global_object);
|
||||||
|
|
||||||
|
auto& vm = global_object.vm();
|
||||||
|
define_direct_property(*vm.well_known_symbol_to_string_tag(), JS::js_string(vm, "@name@"), JS::Attribute::Configurable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@wrapper_class@::~@wrapper_class@()
|
@wrapper_class@::~@wrapper_class@()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue