From f8f2691349d9f0e1658861328e7e1573fef813de Mon Sep 17 00:00:00 2001 From: Yosuke Furukawa Date: Sat, 17 Jan 2015 13:08:30 +0900 Subject: [PATCH] util: check RegExp is function --- lib/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index b2bfa7c5ddd56b..2dc2259338f9a3 100644 --- a/lib/util.js +++ b/lib/util.js @@ -81,7 +81,8 @@ exports.debuglog = function(set) { debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + if (isFunction(RegExp) && + new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments);