Skip to content

Commit 4cc298a

Browse files
committed
fix a couple of tests
1 parent c5e2d95 commit 4cc298a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/core-js/internals/schedulers-fix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Function = global.Function;
1212
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
1313
var version = global.Bun.version.split('.');
1414
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
15-
});
15+
})();
1616

1717
// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
1818
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

tests/compat/tests.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,17 @@ function createStringTrimMethodTest(METHOD_NAME) {
223223
}
224224

225225
function IMMEDIATE() {
226-
return setImmediate && clearImmediate && !IS_BUN;
226+
return setImmediate && clearImmediate && !(IS_BUN && (function () {
227+
var version = global.Bun.version.split('.');
228+
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
229+
})());
227230
}
228231

229232
function TIMERS() {
230-
return !IS_BUN && !/MSIE .\./.test(USERAGENT);
233+
return !(/MSIE .\./.test(USERAGENT) || IS_BUN && (function () {
234+
var version = global.Bun.version.split('.');
235+
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
236+
})());
231237
}
232238

233239
GLOBAL.tests = {

0 commit comments

Comments
 (0)