Skip to content

Commit a490018

Browse files
committed
workaround testing.refAllDecls issue
1 parent 405e9a9 commit a490018

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/engines/v8/v8.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ pub const Env = struct {
355355
// Currently used for DOM nodes
356356
// - value Note: *parser.Node should be converted to dom/node.zig.Union to get the most precise type
357357
pub fn findOrAddValue(env: *Env, value: anytype) !v8.Value {
358+
if (builtin.is_test) {
359+
// std.testing.refAllDecls(@import("server.zig")); Causes `try ret.lookup(gen.Types);` to throw an error
360+
return error.TestingNotSupported;
361+
}
358362
comptime var ret: refl.Type = undefined;
359363
comptime {
360364
@setEvalBranchQuota(150_000); // Needed when this is called with a dom/node.zig.Union

0 commit comments

Comments
 (0)