Add C++ exception handler

This commit is contained in:
Jarred Sumner
2022-01-23 20:10:51 -08:00
parent 9c627e884d
commit 084d78be29
2 changed files with 3 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ extern "C" void JSCInitialize() {
JSC::Options::exposeInternalModuleLoader() = true;
JSC::Options::useSharedArrayBuffer() = true;
// JSC::Options::useAtMethod() = true;
// std::set_terminate([]() { Zig__GlobalObject__onCrash(); });
std::set_terminate([]() { Zig__GlobalObject__onCrash(); });
WTF::initializeMainThread();
JSC::initialize();
}

View File

@@ -431,7 +431,8 @@ pub fn NewGlobalObject(comptime Type: type) type {
}
Output.flush();
std.os.abort();
const Reporter = @import("../../../report.zig");
Reporter.fatal(null, "A C++ exception occurred");
}
};
}