Browse Source

fix issue #11

master
Bernard McManus 9 years ago
parent
commit
e74c9c4289
  1. 10
      util.js

10
util.js

@ -73,17 +73,17 @@ exports.format = function(f) {
// Returns a modified function which warns once by default. // Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op. // If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) { exports.deprecate = function(fn, msg) {
if (typeof process !== 'undefined' && process.noDeprecation === true) {
return fn;
}
// Allow for deprecating things in the process of starting up. // Allow for deprecating things in the process of starting up.
if (isUndefined(global.process)) { if (typeof process === 'undefined') {
return function() { return function() {
return exports.deprecate(fn, msg).apply(this, arguments); return exports.deprecate(fn, msg).apply(this, arguments);
}; };
} }
if (process.noDeprecation === true) {
return fn;
}
var warned = false; var warned = false;
function deprecated() { function deprecated() {
if (!warned) { if (!warned) {

Loading…
Cancel
Save