From e74c9c4289589ecc716c6b193e3989b654d73f56 Mon Sep 17 00:00:00 2001 From: Bernard McManus Date: Wed, 30 Mar 2016 15:08:40 -0400 Subject: [PATCH] fix issue #11 --- util.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util.js b/util.js index cbc2498..4f25671 100644 --- a/util.js +++ b/util.js @@ -73,17 +73,17 @@ exports.format = function(f) { // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { + if (typeof process !== 'undefined' && process.noDeprecation === true) { + return fn; + } + // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { + if (typeof process === 'undefined') { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } - if (process.noDeprecation === true) { - return fn; - } - var warned = false; function deprecated() { if (!warned) {