Skip to content

Commit

Permalink
fix a couple of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 20, 2022
1 parent c5e2d95 commit 4cc298a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core-js/internals/schedulers-fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var Function = global.Function;
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
var version = global.Bun.version.split('.');
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
});
})();

// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
Expand Down
10 changes: 8 additions & 2 deletions tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,17 @@ function createStringTrimMethodTest(METHOD_NAME) {
}

function IMMEDIATE() {
return setImmediate && clearImmediate && !IS_BUN;
return setImmediate && clearImmediate && !(IS_BUN && (function () {
var version = global.Bun.version.split('.');
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
})());
}

function TIMERS() {
return !IS_BUN && !/MSIE .\./.test(USERAGENT);
return !(/MSIE .\./.test(USERAGENT) || IS_BUN && (function () {
var version = global.Bun.version.split('.');
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
})());
}

GLOBAL.tests = {
Expand Down

0 comments on commit 4cc298a

Please sign in to comment.