mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1500 from lightpanda-io/console_table
Add console.table
This commit is contained in:
@@ -550,14 +550,14 @@ pub fn unknownObjectPropertyCallback(comptime JsApi: type) *const fn (?*const v8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JsApi == @import("../webapi/element/Html.zig") or JsApi == @import("../webapi/Element.zig") or JsApi == @import("../webapi/element/html/Custom.zig")) {
|
if (JsApi == @import("../webapi/element/Html.zig").JsApi or JsApi == @import("../webapi/Element.zig").JsApi or JsApi == @import("../webapi/element/html/Custom.zig").JsApi) {
|
||||||
// react ?
|
// react ?
|
||||||
if (std.mem.eql(u8, property, "props")) return 0;
|
if (std.mem.eql(u8, property, "props")) return 0;
|
||||||
if (std.mem.eql(u8, property, "hydrated")) return 0;
|
if (std.mem.eql(u8, property, "hydrated")) return 0;
|
||||||
if (std.mem.eql(u8, property, "isHydrated")) return 0;
|
if (std.mem.eql(u8, property, "isHydrated")) return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JsApi == @import("../webapi/Console.zig")) {
|
if (JsApi == @import("../webapi/Console.zig").JsApi) {
|
||||||
if (std.mem.eql(u8, property, "firebug")) return 0;
|
if (std.mem.eql(u8, property, "firebug")) return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ pub fn @"error"(_: *const Console, values: []js.Value, page: *Page) void {
|
|||||||
logger.warn(.js, "console.error", .{ValueWriter{ .page = page, .values = values, .include_stack = true }});
|
logger.warn(.js, "console.error", .{ValueWriter{ .page = page, .values = values, .include_stack = true }});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn table(_: *const Console, data: js.Value, columns: ?js.Value) void {
|
||||||
|
logger.info(.js, "console.table", .{ .data = data, .columns = columns });
|
||||||
|
}
|
||||||
|
|
||||||
pub fn count(self: *Console, label_: ?[]const u8, page: *Page) !void {
|
pub fn count(self: *Console, label_: ?[]const u8, page: *Page) !void {
|
||||||
const label = label_ orelse "default";
|
const label = label_ orelse "default";
|
||||||
const gop = try self._counts.getOrPut(page.arena, label);
|
const gop = try self._counts.getOrPut(page.arena, label);
|
||||||
@@ -178,6 +182,7 @@ pub const JsApi = struct {
|
|||||||
pub const assert = bridge.function(Console.assert, .{});
|
pub const assert = bridge.function(Console.assert, .{});
|
||||||
pub const @"error" = bridge.function(Console.@"error", .{});
|
pub const @"error" = bridge.function(Console.@"error", .{});
|
||||||
pub const exception = bridge.function(Console.@"error", .{});
|
pub const exception = bridge.function(Console.@"error", .{});
|
||||||
|
pub const table = bridge.function(Console.table, .{});
|
||||||
pub const count = bridge.function(Console.count, .{});
|
pub const count = bridge.function(Console.count, .{});
|
||||||
pub const countReset = bridge.function(Console.countReset, .{});
|
pub const countReset = bridge.function(Console.countReset, .{});
|
||||||
pub const time = bridge.function(Console.time, .{});
|
pub const time = bridge.function(Console.time, .{});
|
||||||
|
|||||||
Reference in New Issue
Block a user