[go: nahoru, domu]

blob: 9f730e41752c75f0d167ac4354b108637628428e [file] [log] [blame]
Jack Franklinb5bbcc02020-02-11 10:14:111"use strict";
2
3/* istanbul ignore next : not testing that setTimeout works */
4function nextTick(callback) {
5 setTimeout(callback, 0);
6}
7
8module.exports = function getNextTick(process, setImmediate) {
9 if (typeof process === "object" && typeof process.nextTick === "function") {
10 return process.nextTick;
11 }
12
13 if (typeof setImmediate === "function") {
14 return setImmediate;
15 }
16
17 return nextTick;
18};