Ability to return typed arrays

This commit is contained in:
Karl Seguin
2025-05-12 17:47:05 +08:00
parent b5eea2136b
commit 212d7f1865
4 changed files with 125 additions and 6 deletions

View File

@@ -26,15 +26,16 @@ pub const allocator = std.testing.allocator;
// browser.Env or the browser.SessionState
pub fn Runner(comptime State: type, comptime Global: type, comptime types: anytype) type {
const AdjustedTypes = if (Global == void) generate.Tuple(.{ types, DefaultGlobal }) else types;
const Env = js.Env(State, struct {
pub const Interfaces = AdjustedTypes;
});
return struct {
env: *Env,
scope: *Env.Scope,
executor: Env.Executor,
pub const Env = js.Env(State, struct {
pub const Interfaces = AdjustedTypes;
});
const Self = @This();
pub fn init(state: State, global: Global) !*Self {