Skip to content

Commit 655b9eb

Browse files
committed
userctx: remove getter, allow multiple set
1 parent 8528b98 commit 655b9eb

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/engines/v8/v8.zig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,9 @@ pub const Env = struct {
136136
}
137137

138138
pub fn setUserContext(self: *Env, userctx: public.UserContext) anyerror!void {
139-
// you can't replace a user context defined in init.
140-
if (self.nat_ctx.userctx != null) return error.UserContextExists;
141-
142139
self.nat_ctx.userctx = userctx;
143140
}
144141

145-
pub fn getUserContext(self: *Env) ?*public.UserContext {
146-
if (self.nat_ctx.userctx) |*ctx| return ctx;
147-
return null;
148-
}
149-
150142
// load user-defined Types into Javascript environement
151143
pub fn load(self: Env, js_types: []usize) anyerror!void {
152144
var tpls: [gen.Types.len]TPL = undefined;

src/interfaces.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ pub fn Env(
5555
userctx: public.UserContext,
5656
) anyerror!void);
5757

58-
assertDecl(T, "getUserContext", fn (self: *T) ?*public.UserContext);
59-
6058
// start()
6159
assertDecl(T, "start", fn (
6260
self: *T,

0 commit comments

Comments
 (0)