Skip to content

Commit 8a9064b

Browse files
committed
errdefer in the right scope
1 parent 42465e5 commit 8a9064b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/js.zig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,8 @@ pub fn Env(comptime S: type, comptime types: anytype) type {
309309
}
310310

311311
const context = v8.Context.init(isolate, global_template, null);
312-
if (kind == .main) {
313-
context.enter();
314-
errdefer context.exit();
315-
}
312+
if (kind == .main) context.enter();
313+
errdefer if (kind == .main) context.exit();
316314

317315
// This shouldn't be necessary, but it is:
318316
// https://groups.google.com/g/v8-users/c/qAQQBmbi--8

0 commit comments

Comments
 (0)