mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
support int enums in jsValueToZig
This commit is contained in:
@@ -938,6 +938,12 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
}
|
}
|
||||||
unreachable;
|
unreachable;
|
||||||
},
|
},
|
||||||
|
.@"enum" => |e| {
|
||||||
|
switch (@typeInfo(e.tag_type)) {
|
||||||
|
.int => return std.meta.intToEnum(T, try jsIntToZig(e.tag_type, js_value, self.context)),
|
||||||
|
else => @compileError(named_function.full_name ++ " has an unsupported enum parameter type: " ++ @typeName(T)),
|
||||||
|
}
|
||||||
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user