Skip to content

Commit 6bf5e85

Browse files
authored
Fix scheduler setTimeout() re-entrancy check (#14384)
1 parent 7a48c90 commit 6bf5e85

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/scheduler/src/Scheduler.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,11 @@ if (globalValue && globalValue._schedMock) {
473473
var _callback = null;
474474
var _flushCallback = function(didTimeout) {
475475
if (_callback !== null) {
476-
var cb = _callback;
477-
_callback = null;
478-
cb(didTimeout);
476+
try {
477+
_callback(didTimeout);
478+
} finally {
479+
_callback = null;
480+
}
479481
}
480482
};
481483
requestHostCallback = function(cb, ms) {

0 commit comments

Comments
 (0)