diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-06 15:08:13 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-06 15:08:13 +0200 |
| commit | 12a02f161504b49a54243bed996df6b44e25b7b4 (patch) | |
| tree | 5aa9d142a6faba51730d0eeb69ffc0a0766d21c6 /src/z/root.zig | |
| parent | a4b2398aba2211ce5901ceb46f73057864bd1707 (diff) | |
refactor wasm
Diffstat (limited to 'src/z/root.zig')
| -rw-r--r-- | src/z/root.zig | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/src/z/root.zig b/src/z/root.zig index fc42acd..e18193b 100644 --- a/src/z/root.zig +++ b/src/z/root.zig @@ -1,29 +1,16 @@ const builtin = @import("builtin"); const std = @import("std"); -const wasm = wasm_struct: { - if (builtin.target.cpu.arch.isWasm()) { - break :wasm_struct struct { - pub const env = @import("env/root.zig"); - pub const Env = @import("Env/root.zig"); - - export const bit_length: u8 = @sizeOf(usize); - }; - } - - break :wasm_struct struct { - pub const Env = struct { - pub const Object = struct {}; - }; - }; -}; - -pub const env = wasm.env; -pub const Env = wasm.Env; +pub const log = @import("log/root.zig"); +pub const Env = @import("Env/root.zig"); +pub const Object = @import("Object.zig"); pub const App = @import("App/root.zig").App; +pub const Options = @import("App/root.zig").Options; + +fn defaultPanic(msg: []const u8, _: ?usize) noreturn { + log.js.err(msg); + @trap(); +} -pub const allocator: std.mem.Allocator = if (builtin.target.cpu.arch.isWasm()) .{ - .ptr = undefined, - .vtable = &std.heap.BrkAllocator.vtable, -} else .failing; +pub const panic = std.debug.FullPanic(defaultPanic); |