aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/gc.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-02 01:56:41 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-02 01:56:41 -0800
commitb53a3328093a02c3a402590677c45034f073d230 (patch)
tree1f75b7bc81254dab0f10bd423d35e330b4f7ef18 /test/bun.js/gc.js
parenta09b515a62d78c4ee71c282ba6cc0402fbd765c7 (diff)
downloadbun-b53a3328093a02c3a402590677c45034f073d230.tar.gz
bun-b53a3328093a02c3a402590677c45034f073d230.tar.zst
bun-b53a3328093a02c3a402590677c45034f073d230.zip
Fix running tests in older versions of bun
Diffstat (limited to 'test/bun.js/gc.js')
-rw-r--r--test/bun.js/gc.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/bun.js/gc.js b/test/bun.js/gc.js
index 6c444126f..523c5c1e4 100644
--- a/test/bun.js/gc.js
+++ b/test/bun.js/gc.js
@@ -14,6 +14,8 @@ export function gcTick(trace = false) {
}
export function withoutAggressiveGC(block) {
+ if (!Bun.unsafe.gcAggressionLevel) return block();
+
const origGC = Bun.unsafe.gcAggressionLevel();
Bun.unsafe.gcAggressionLevel(0);
try {