mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS+WebContent: Implement console.table
- Expose table from console object - Add new Table log level - Create a JS object that represents table rows and columns - Print table as HTML using WebContentConsoleClient
This commit is contained in:
committed by
Sam Atkins
parent
a2a9a11466
commit
785180dd45
@@ -45,6 +45,7 @@ void ConsoleObject::initialize(Realm& realm)
|
||||
define_native_function(realm, vm.names.error, error, 0, attr);
|
||||
define_native_function(realm, vm.names.info, info, 0, attr);
|
||||
define_native_function(realm, vm.names.log, log, 0, attr);
|
||||
define_native_function(realm, vm.names.table, table, 0, attr);
|
||||
define_native_function(realm, vm.names.trace, trace, 0, attr);
|
||||
define_native_function(realm, vm.names.warn, warn, 0, attr);
|
||||
define_native_function(realm, vm.names.dir, dir, 0, attr);
|
||||
@@ -102,6 +103,13 @@ JS_DEFINE_NATIVE_FUNCTION(ConsoleObject::log)
|
||||
return console_object.console().log();
|
||||
}
|
||||
|
||||
// 1.1.7. table(tabularData, properties), https://console.spec.whatwg.org/#table
|
||||
JS_DEFINE_NATIVE_FUNCTION(ConsoleObject::table)
|
||||
{
|
||||
auto& console_object = *vm.current_realm()->intrinsics().console_object();
|
||||
return console_object.console().table();
|
||||
}
|
||||
|
||||
// 1.1.8. trace(...data), https://console.spec.whatwg.org/#trace
|
||||
JS_DEFINE_NATIVE_FUNCTION(ConsoleObject::trace)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user