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.
2 parents 0a29e9b + d8fa9b8 commit f3d8ec0Copy full SHA for f3d8ec0
src/runtime/js.zig
@@ -1403,6 +1403,13 @@ pub fn Env(comptime S: type, comptime types: anytype) type {
1403
return @constCast(@as(*const T, &.{}));
1404
}
1405
1406
+ // if it isn't an empty struct, then the v8.Object should have an
1407
+ // InternalFieldCount > 0, since our toa pointer should be embedded
1408
+ // at index 0 of the internal field count.
1409
+ if (js_obj.internalFieldCount() == 0) {
1410
+ return error.InvalidArgument;
1411
+ }
1412
+
1413
const type_name = @typeName(T);
1414
if (@hasField(TypeLookup, type_name) == false) {
1415
@compileError(std.fmt.comptimePrint(
0 commit comments