aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--integration/apps/bun-create-next.sh4
-rw-r--r--integration/apps/bun-create-react.sh2
-rw-r--r--src/http.zig3
3 files changed, 7 insertions, 2 deletions
diff --git a/integration/apps/bun-create-next.sh b/integration/apps/bun-create-next.sh
index f0e4e2a5e..fc1318886 100644
--- a/integration/apps/bun-create-next.sh
+++ b/integration/apps/bun-create-next.sh
@@ -1,12 +1,14 @@
#!/bin/bash
+# The important part of this test: make sure that Bun.js successfully loads
+# The most likely reason for this test to fail is that something broke in the JavaScriptCore <> Bun integration
killall -9 $(basename $BUN_BIN) || echo "";
rm -rf /tmp/next-app;
mkdir -p /tmp/next-app;
$BUN_BIN create next /tmp/next-app;
cd /tmp/next-app;
-$BUN_BIN --port 8087 &
+BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN --port 8087 &
sleep 0.005
curl --fail http://localhost:8087/ && killall -9 $(basename $BUN_BIN) && echo "✅ bun create next passed."
diff --git a/integration/apps/bun-create-react.sh b/integration/apps/bun-create-react.sh
index 3de1f5c09..d434c9f28 100644
--- a/integration/apps/bun-create-react.sh
+++ b/integration/apps/bun-create-react.sh
@@ -6,7 +6,7 @@ rm -rf /tmp/react-app;
mkdir -p /tmp/react-app;
$BUN_BIN create react /tmp/react-app;
cd /tmp/react-app;
-$BUN_BIN --port 8087 &
+BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN --port 8087 &
sleep 0.005
curl --fail http://localhost:8087/ && killall -9 $(basename $BUN_BIN) && echo "✅ bun create react passed."
diff --git a/src/http.zig b/src/http.zig
index d6de0a913..896c54812 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -1205,6 +1205,9 @@ pub const RequestContext = struct {
var module_map = ZigGlobalObject.getModuleRegistryMap(vm.global);
if (!VM.isJITEnabled()) {
Output.prettyErrorln("<red><r>warn:<r> JIT is disabled,,,this is a bug in Bun and/or a permissions problem. JS will run slower.", .{});
+ if (vm.bundler.env.map.get("BUN_CRASH_WITHOUT_JIT") != null) {
+ Global.crash();
+ }
}
while (true) {