aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/z/Env/root.zig3
-rw-r--r--src/z/Object.zig4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/z/Env/root.zig b/src/z/Env/root.zig
index 6cc5ae3..6fd2bab 100644
--- a/src/z/Env/root.zig
+++ b/src/z/Env/root.zig
@@ -1,6 +1,5 @@
const std = @import("std");
-
const Self = @This();
const js = @import("js.zig");
@@ -18,6 +17,8 @@ pool: std.heap.MemoryPool(Value) = .empty,
results: std.ArrayList(*Value) = .empty,
gpa: std.mem.Allocator,
+pub const default: Self = .{ .gpa = std.heap.wasm_allocator };
+
pub fn init(gpa: std.mem.Allocator) Self {
return .{ .gpa = gpa };
}
diff --git a/src/z/Object.zig b/src/z/Object.zig
index 4e66e5b..064d48b 100644
--- a/src/z/Object.zig
+++ b/src/z/Object.zig
@@ -18,8 +18,8 @@ pub inline fn delete(self: *Self, env: *Env, key: anytype) Future(.undefined) {
return env.deleteProp(self, key);
}
-pub inline fn call(self: *Self, env: *Env, method: @EnumLiteral(), args: anytype) AnyFuture {
- return env.callMethod(self, @tagName(method), args);
+pub inline fn call(self: *Self, env: *Env, method: []const u8, args: anytype) AnyFuture {
+ return env.callMethod(self, method, args);
}
pub inline fn free(self: *Self, env: *Env) Future(.undefined) {