From a68b5eef86b5e2e8b05a36b2bd7cc9305c6f1146 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sat, 30 Oct 2021 04:52:15 -0700 Subject: [PATCH] [Bun.js] Enable SharedArrayBuffer --- src/CHANGELOG.md | 4 ++++ src/javascript/jsc/bindings/ZigGlobalObject.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 0e377b3723..6c97c01e57 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,9 @@ # Upcoming release +- [Bun.js] Enable `SharedArrayBuffer` and Atomics + +# 0.41.0 + - [bun run] `bun run ./file.js` now supports running JavaScript, TS, TSX, and JSX files with Bun.js. Before, it would say `"error: Missing script"`. If there is a `#!` shebang at the start of the file, the file will not be run with Bun.js. You can still use Node & Deno with `bun run`, that works the same as before. - [Bun.js] Top-level await - [Bun.js] `performance.now()` is implemented diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.cpp b/src/javascript/jsc/bindings/ZigGlobalObject.cpp index ba5a2835a2..b8470ce4be 100644 --- a/src/javascript/jsc/bindings/ZigGlobalObject.cpp +++ b/src/javascript/jsc/bindings/ZigGlobalObject.cpp @@ -89,6 +89,9 @@ extern "C" void JSCInitialize() { JSC::Options::useSourceProviderCache() = true; JSC::Options::useUnlinkedCodeBlockJettisoning() = false; JSC::Options::exposeInternalModuleLoader() = true; + JSC::Options::useSharedArrayBuffer() = true; + // JSC::Options::useAtMethod() = true; + // std::set_terminate([]() { Zig__GlobalObject__onCrash(); }); WTF::initializeMainThread(); JSC::initialize();