diff options
Diffstat (limited to 'src/z/Env')
| -rw-r--r-- | src/z/Env/Object.zig | 29 | ||||
| -rw-r--r-- | src/z/Env/root.zig | 7 | ||||
| -rw-r--r-- | src/z/Env/value.zig | 2 |
3 files changed, 5 insertions, 33 deletions
diff --git a/src/z/Env/Object.zig b/src/z/Env/Object.zig deleted file mode 100644 index 77afa1f..0000000 --- a/src/z/Env/Object.zig +++ /dev/null @@ -1,29 +0,0 @@ -const Env = @import("root.zig"); -const AnyFuture = Env.AnyFuture; -const Future = Env.Future; - -const Self = @This(); - -pub inline fn get(self: *Self, env: *Env, key: anytype) AnyFuture { - return env.getProp(self, key); -} - -pub inline fn set(self: *Self, env: *Env, key: anytype, value: anytype) Future(.undefined) { - return env.setProp(self, key, value); -} - -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 free(self: *Self, env: *Env) Future(.undefined) { - return env.free(self); -} - -pub fn new(self: *Self, env: *Env) Future(.object) { - return env.new(self, .{}); -} diff --git a/src/z/Env/root.zig b/src/z/Env/root.zig index 5a08362..6cc5ae3 100644 --- a/src/z/Env/root.zig +++ b/src/z/Env/root.zig @@ -1,15 +1,16 @@ const std = @import("std"); -const js = @import("js.zig"); const Self = @This(); -pub const Call = @import("call.zig").Call; +const js = @import("js.zig"); const future = @import("future.zig"); +const Object = @import("../Object.zig"); + +pub const Call = @import("call.zig").Call; pub const AnyFuture = future.AnyFuture; pub const Future = future.Future; pub const Value = @import("value.zig").Value; -pub const Object = @import("Object.zig"); calls: std.ArrayList(Call) = .empty, values: std.ArrayList(Value) = .empty, diff --git a/src/z/Env/value.zig b/src/z/Env/value.zig index b077fb2..59b788f 100644 --- a/src/z/Env/value.zig +++ b/src/z/Env/value.zig @@ -1,5 +1,5 @@ const std = @import("std"); -const Object = @import("root.zig").Object; +const Object = @import("../Object.zig"); pub fn isString(comptime T: type) bool { return comptime blk: { |