diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-19 15:14:01 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-19 15:16:33 +0200 |
| commit | bbd1364de53186af975ef1694fdc8451208ce626 (patch) | |
| tree | 467e72f70b0fca12fb053618913ee247f7721137 /src/zilch/Object.zig | |
| parent | 5b7b5c48e50d377b794dbbfc1c270ec6fd387e4b (diff) | |
zilch: make object calls type agnostic
Diffstat (limited to 'src/zilch/Object.zig')
| -rw-r--r-- | src/zilch/Object.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zilch/Object.zig b/src/zilch/Object.zig index b37f40b..1d30b8a 100644 --- a/src/zilch/Object.zig +++ b/src/zilch/Object.zig @@ -7,27 +7,27 @@ const Function = Env.Function; const Self = @This(); -pub inline fn get(self: *Self, env: *Env, key: anytype) AnyFuture { +pub inline fn get(self: anytype, env: *Env, key: anytype) AnyFuture { return env.call(bindings.get, .{ self, key }); } -pub inline fn set(self: *Self, env: *Env, key: anytype, value: anytype) Future(void) { +pub inline fn set(self: anytype, env: *Env, key: anytype, value: anytype) Future(void) { return .fromAny(env.call(bindings.set, .{ self, key, value })); } -pub inline fn delete(self: *Self, env: *Env, key: anytype) Future(void) { +pub inline fn delete(self: anytype, env: *Env, key: anytype) Future(void) { return .fromAny(env.call(bindings.delete, .{ self, key })); } -pub inline fn call(self: *Self, env: *Env, method: []const u8, args: anytype) AnyFuture { +pub inline fn call(self: anytype, env: *Env, method: []const u8, args: anytype) AnyFuture { return env.call(bindings.call, .{ self, method } ++ args); } -pub inline fn free(self: *Self, env: *Env) Future(void) { +pub inline fn free(self: anytype, env: *Env) Future(void) { return .fromAny(env.call(bindings.free, .{self})); } -pub inline fn new(self: *Self, env: *Env) Future(*Self) { +pub inline fn new(self: anytype, env: *Env) Future(*Self) { return .fromAny(env.call(bindings.new, .{self})); } |