Skip to content

Commit

Permalink
Deprecate sys.p()
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 20, 2010
1 parent 44ad6a7 commit 022c083
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
}
Expand Down

0 comments on commit 022c083

Please sign in to comment.