Skip to content

Commit

Permalink
Fix requiring timers module with non standard require (#18632)
Browse files Browse the repository at this point in the history
fixes #18589
  • Loading branch information
just-boris authored Apr 16, 2020
1 parent 5f6b75d commit 7b4403c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/enqueueTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function enqueueTask(task: () => void) {
const nodeRequire = module && module[requireString];
// assuming we're in node, let's try to get node's
// version of setImmediate, bypassing fake timers if any.
enqueueTaskImpl = nodeRequire('timers').setImmediate;
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
} catch (_err) {
// we're in a browser
// we can't use regular timers because they may still be faked
Expand Down

0 comments on commit 7b4403c

Please sign in to comment.