From 022c0838480ddec334e85dd8a8ca7d376eb26d95 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 20 May 2010 10:12:05 -0700 Subject: [PATCH] Deprecate sys.p() --- lib/sys.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sys.js b/lib/sys.js index 7bf582d88d..d37eab2799 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -182,7 +182,13 @@ exports.inspect = function (obj, showHidden, depth) { return format(obj, (typeof depth === 'undefined' ? 2 : depth)); }; +var pWarning; + exports.p = function () { + if (!pWarning) { + pWarning = "sys.p will be removed in future versions of Node. Use sys.puts(sys.inspect()) instead.\n"; + exports.error(pWarning); + } for (var i = 0, len = arguments.length; i < len; ++i) { error(exports.inspect(arguments[i])); }