Browse Source

Deprecate sys.p()

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
022c083848
  1. 6
      lib/sys.js

6
lib/sys.js

@ -182,7 +182,13 @@ exports.inspect = function (obj, showHidden, depth) {
return format(obj, (typeof depth === 'undefined' ? 2 : depth)); return format(obj, (typeof depth === 'undefined' ? 2 : depth));
}; };
var pWarning;
exports.p = function () { 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) { for (var i = 0, len = arguments.length; i < len; ++i) {
error(exports.inspect(arguments[i])); error(exports.inspect(arguments[i]));
} }

Loading…
Cancel
Save