diff --git a/Tests/LibWeb/Text/expected/console/console-to-string-tag.txt b/Tests/LibWeb/Text/expected/console/console-to-string-tag.txt new file mode 100644 index 00000000000..36e20689c3a --- /dev/null +++ b/Tests/LibWeb/Text/expected/console/console-to-string-tag.txt @@ -0,0 +1,2 @@ +console +[object console] diff --git a/Tests/LibWeb/Text/input/console/console-to-string-tag.html b/Tests/LibWeb/Text/input/console/console-to-string-tag.html new file mode 100644 index 00000000000..06460612311 --- /dev/null +++ b/Tests/LibWeb/Text/input/console/console-to-string-tag.html @@ -0,0 +1,7 @@ + + diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp index b4843cb2c1a..468168adf51 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -50,6 +50,8 @@ void ConsoleObject::initialize(Realm& realm) define_native_function(realm, vm.names.time, time, 0, attr); define_native_function(realm, vm.names.timeLog, time_log, 0, attr); define_native_function(realm, vm.names.timeEnd, time_end, 0, attr); + + define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, "console"_string), Attribute::Configurable); } // 1.1.1. assert(condition, ...data), https://console.spec.whatwg.org/#assert