@@ -618,7 +618,7 @@ pub fn setNativeType(
618618 const info = @typeInfo (@TypeOf (res ));
619619
620620 // Optional
621- if (info == .Optional ) {
621+ if (info == .optional ) {
622622 if (res == null ) {
623623 // if null just return JS null
624624 return isolate .initNull ().toValue ();
@@ -919,7 +919,7 @@ fn callFunc(
919919 const function = @field (T_refl .T , func .name );
920920 const res_T = comptime func .return_type .underErr () orelse func .return_type .T ;
921921 var res : res_T = undefined ;
922- if (comptime @typeInfo (func .return_type .T ) == .ErrorUnion ) {
922+ if (comptime @typeInfo (func .return_type .T ) == .error_union ) {
923923 res = @call (.auto , function , args ) catch | err | {
924924 // TODO: how to handle internal errors vs user errors
925925 const js_err = throwError (
@@ -1106,7 +1106,7 @@ fn staticAttrsKeys(
11061106 return ;
11071107 }
11081108 const attrs_T = T_refl .static_attrs_T .? ;
1109- inline for (@typeInfo (attrs_T ).Struct .fields , 0.. ) | field , i | {
1109+ inline for (@typeInfo (attrs_T ).@ "struct" .fields , 0.. ) | field , i | {
11101110 keys [i ] = v8 .String .initUtf8 (isolate , field .name ).toName ();
11111111 }
11121112}
@@ -1121,7 +1121,7 @@ fn staticAttrsValues(
11211121 }
11221122 const attrs_T = T_refl .static_attrs_T .? ;
11231123 const attrs = comptime T_refl .staticAttrs (attrs_T );
1124- inline for (@typeInfo (attrs_T ).Struct .fields , 0.. ) | field , i | {
1124+ inline for (@typeInfo (attrs_T ).@ "struct" .fields , 0.. ) | field , i | {
11251125 const value = comptime @field (attrs , field .name );
11261126 values [i ] = nativeToJS (@TypeOf (value ), value , isolate ) catch unreachable ;
11271127 }
@@ -1137,7 +1137,7 @@ fn setStaticAttrs(
11371137 return ;
11381138 }
11391139 const attrs_T = T_refl .static_attrs_T .? ;
1140- inline for (@typeInfo (attrs_T ).Struct .fields , 0.. ) | _ , i | {
1140+ inline for (@typeInfo (attrs_T ).@ "struct" .fields , 0.. ) | _ , i | {
11411141 template .set (keys [i ], values [i ], v8 .PropertyAttribute .ReadOnly + v8 .PropertyAttribute .DontDelete );
11421142 }
11431143}
@@ -1198,7 +1198,7 @@ pub fn loadFunctionTemplate(
11981198 // static attributes keys and values
11991199 comptime var static_nb : usize = undefined ;
12001200 if (T_refl .static_attrs_T ) | attr_T | {
1201- static_nb = @typeInfo (attr_T ).Struct .fields .len ;
1201+ static_nb = @typeInfo (attr_T ).@ "struct" .fields .len ;
12021202 } else {
12031203 static_nb = 0 ;
12041204 }
0 commit comments