From 13cfd8aa43e9916c408882789c3b0c3add448d39 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 11 Aug 2016 22:07:13 -0400 Subject: [PATCH] Calling process.hrtime is predicated on being called with an Array type with two elements or with no explicit parameters. Node 4 (LTS) seems to be persnickety regarding matching undefined as a actual parameter in process.hrtime (and possibly all functions). --- lib/bcoin/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bcoin/utils.js b/lib/bcoin/utils.js index 7e4b3ba8..59adf4ca 100644 --- a/lib/bcoin/utils.js +++ b/lib/bcoin/utils.js @@ -403,7 +403,8 @@ utils.hrtime = function hrtime(time) { return [sec, ms * 1e6]; } - return process.hrtime(time); + return Array.isArray(time) && time.length == 2 ? + process.hrtime(time) : process.hrtime(); }; /**