We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66ec087 commit d8fa9b8Copy full SHA for d8fa9b8
src/runtime/js.zig
@@ -1340,6 +1340,13 @@ pub fn Env(comptime S: type, comptime types: anytype) type {
1340
return @constCast(@as(*const T, &.{}));
1341
}
1342
1343
+ // if it isn't an empty struct, then the v8.Object should have an
1344
+ // InternalFieldCount > 0, since our toa pointer should be embedded
1345
+ // at index 0 of the internal field count.
1346
+ if (js_obj.internalFieldCount() == 0) {
1347
+ return error.InvalidArgument;
1348
+ }
1349
+
1350
const type_name = @typeName(T);
1351
if (@hasField(TypeLookup, type_name) == false) {
1352
@compileError(std.fmt.comptimePrint(
0 commit comments