Skip to content

Commit 18d6dbf

Browse files
authored
Increase compatiblity with sinon.useFakeTimers()
1 parent 4f37b97 commit 18d6dbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/es6-promise/asap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ function useMessageChannel() {
7373
}
7474

7575
function useSetTimeout() {
76+
// Store setTimeout reference so es6-promise will be unaffected by
77+
// other code modifying setTimeout (like sinon.useFakeTimers())
78+
var globalSetTimeout = setTimeout;
7679
return function() {
77-
setTimeout(flush, 1);
80+
globalSetTimeout(flush, 1);
7881
};
7982
}
8083

0 commit comments

Comments
 (0)