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:
Andreas Kling 2022-03-29 17:02:37 +02:00
parent 427beb97b5
commit ab4c73746c
Notes: sideshowbarker 2024-07-17 20:33:50 +09:00

View file

@ -1694,6 +1694,9 @@ namespace Web::Bindings {
void @wrapper_class@::initialize(JS::GlobalObject& 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@()