mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
print value using toDetailString
This commit is contained in:
@@ -2597,7 +2597,7 @@ fn Caller(comptime E: type, comptime State: type) type {
|
||||
var arr: std.ArrayListUnmanaged(u8) = .{};
|
||||
for (0..js_parameter_count) |i| {
|
||||
const js_value = info.getArg(@intCast(i));
|
||||
const value_string = try valueToString(arena, js_value, isolate, context);
|
||||
const value_string = try valueToDetailString(arena, js_value, isolate, context);
|
||||
const value_type = try jsStringToZig(arena, try js_value.typeOf(isolate), isolate);
|
||||
try std.fmt.format(arr.writer(arena), "{d}: {s} ({s})\n", .{ i + 1, value_string, value_type });
|
||||
}
|
||||
@@ -2879,6 +2879,11 @@ const TaggedAnyOpaque = struct {
|
||||
subtype: ?SubType,
|
||||
};
|
||||
|
||||
fn valueToDetailString(allocator: Allocator, value: v8.Value, isolate: v8.Isolate, context: v8.Context) ![]u8 {
|
||||
const str = try value.toDetailString(context);
|
||||
return jsStringToZig(allocator, str, isolate);
|
||||
}
|
||||
|
||||
fn valueToString(allocator: Allocator, value: v8.Value, isolate: v8.Isolate, context: v8.Context) ![]u8 {
|
||||
const str = try value.toString(context);
|
||||
return jsStringToZig(allocator, str, isolate);
|
||||
|
||||
Reference in New Issue
Block a user