debian/tests/test_modules/call-me-maybe/src/next.js
raw| 1 | 'use strict' |
| 2 | |
| 3 | function makeNext () { |
| 4 | if (typeof process === 'object' && typeof process.nextTick === 'function') { |
| 5 | return process.nextTick |
| 6 | } else if (typeof setImmediate === 'function') { |
| 7 | return setImmediate |
| 8 | } else { |
| 9 | return function next (f) { |
| 10 | setTimeout(f, 0) |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | module.exports = makeNext() |