Ensure page background tasks are re-registered on reset

This commit is contained in:
Karl Seguin
2025-10-09 16:29:09 +08:00
parent 852c30b2e5
commit 75e0637d2d
3 changed files with 32 additions and 23 deletions

View File

@@ -138,10 +138,7 @@ fn getThis(self: *const Function) v8.Object {
return self.this orelse self.context.v8_context.getGlobal();
}
// debug/helper to print the source of the JS callback
pub fn printFunc(self: Function) !void {
const context = self.context;
pub fn src(self: *const Function) ![]const u8 {
const value = self.func.castToFunction().toValue();
const src = try js.valueToString(context.call_arena, value, context.isolate, context.v8_context);
std.debug.print("{s}\n", .{src});
return self.context.valueToString(value, .{});
}