From 6875fc99c656af685ac07c7d62f8e25019023533 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 26 Jun 2017 03:37:11 -0700 Subject: [PATCH] nexttick: minor. --- lib/utils/nexttick.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils/nexttick.js b/lib/utils/nexttick.js index c45d4b92..365f5574 100644 --- a/lib/utils/nexttick.js +++ b/lib/utils/nexttick.js @@ -7,5 +7,8 @@ 'use strict'; module.exports = function nextTick(handler) { + if (typeof handler !== 'function') + throw new Error('callback must be a function.'); + setImmediate(handler); };