add PerformanceEntry and PerformanceMark

This commit is contained in:
Muki Kiboigo
2025-06-23 09:25:40 -07:00
parent bdb2338b5b
commit 6b651cd5e4
3 changed files with 124 additions and 3 deletions

View File

@@ -2201,7 +2201,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
const T = @TypeOf(value);
switch (@typeInfo(T)) {
.void, .bool, .int, .comptime_int, .float, .comptime_float => {
.void, .bool, .int, .comptime_int, .float, .comptime_float, .@"enum" => {
// Need to do this to keep the compiler happy
// simpleZigValueToJs handles all of these cases.
unreachable;
@@ -3084,6 +3084,12 @@ fn simpleZigValueToJs(isolate: v8.Isolate, value: anytype, comptime fail: bool)
}
},
.@"union" => return simpleZigValueToJs(isolate, std.meta.activeTag(value), fail),
.@"enum" => {
const T = @TypeOf(value);
if (@hasDecl(T, "toString")) {
return simpleZigValueToJs(isolate, value.toString(), fail);
}
},
else => {},
}
if (fail) {