diff --git a/src/engines/v8/v8.zig b/src/engines/v8/v8.zig index d11aec7..aea8dce 100644 --- a/src/engines/v8/v8.zig +++ b/src/engines/v8/v8.zig @@ -274,13 +274,13 @@ pub const Env = struct { } // add a Native object in the Javascript context - pub fn addObject(self: Env, obj: anytype, name: []const u8) anyerror!void { + pub fn addObject(self: *Env, obj: anytype, name: []const u8) anyerror!void { if (self.js_ctx == null) { return error.EnvNotStarted; } return createJSObject( self.nat_ctx.alloc, - self.nat_ctx, + &self.nat_ctx, obj, name, self.js_ctx.?.getGlobal(), diff --git a/src/interfaces.zig b/src/interfaces.zig index 5e98f51..3a0ecc7 100644 --- a/src/interfaces.zig +++ b/src/interfaces.zig @@ -84,7 +84,7 @@ pub fn Env( // addObject() from native api into JS assertDecl(T, "addObject", fn ( - self: T, + self: *T, obj: anytype, name: []const u8, ) anyerror!void);