initialize ICU

This makes functions like new Intl.DateTimeFormat() not crash.
This commit is contained in:
Karl Seguin
2025-04-23 17:41:19 +08:00
parent ba0505c13c
commit 89fea9b4df
7 changed files with 22 additions and 8 deletions

View File

@@ -34,7 +34,10 @@ const SCOPE_ARENA_RETAIN = 1024 * 64;
pub const Platform = struct {
inner: v8.Platform,
pub fn init() Platform {
pub fn init() !Platform {
if (v8.initV8ICU() == false) {
return error.FailedToInitializeICU;
}
const platform = v8.Platform.initDefault(0, true);
v8.initV8Platform(platform);
v8.initV8();