mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Set configurable toStringTag property for console
This commit is contained in:
parent
dd8c693725
commit
c5b8e75204
Notes:
github-actions[bot]
2024-08-11 19:07:22 +00:00
Author: https://github.com/GasimGasimzada
Commit: c5b8e75204
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1015
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 11 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
console
|
||||||
|
[object console]
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
println(console[Symbol.toStringTag])
|
||||||
|
println(console.toString())
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -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.time, time, 0, attr);
|
||||||
define_native_function(realm, vm.names.timeLog, time_log, 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_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
|
// 1.1.1. assert(condition, ...data), https://console.spec.whatwg.org/#assert
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue