replace zig-js-runtime

This commit is contained in:
Karl Seguin
2025-04-02 10:30:59 +08:00
parent 25dcae7648
commit b8d7744563
88 changed files with 5933 additions and 4124 deletions

View File

@@ -72,13 +72,16 @@ pub fn CDPT(comptime TypeProvider: type) type {
pub const Browser = TypeProvider.Browser;
pub const Session = TypeProvider.Session;
pub fn init(app: *App, client: TypeProvider.Client) Self {
pub fn init(app: *App, client: TypeProvider.Client) !Self {
const allocator = app.allocator;
const browser = try Browser.init(app);
errdefer browser.deinit();
return .{
.client = client,
.browser = browser,
.allocator = allocator,
.browser_context = null,
.browser = Browser.init(app),
.message_arena = std.heap.ArenaAllocator.init(allocator),
.browser_context_pool = std.heap.MemoryPool(BrowserContext(Self)).init(allocator),
};