Skip to content

Commit 9fef04c

Browse files
authored
Merge pull request #222 from fpirsch/fix-faketimers
Increase compatiblity with faking time in test tools
2 parents 4f37b97 + 18d6dbf commit 9fef04c

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)