projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44ad6a7
)
Deprecate sys.p()
author
Ryan Dahl
<ry@tinyclouds.org>
Thu, 20 May 2010 17:12:05 +0000
(10:12 -0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Thu, 20 May 2010 17:12:05 +0000
(10:12 -0700)
lib/sys.js
patch
|
blob
|
history
diff --git
a/lib/sys.js
b/lib/sys.js
index
7bf582d
..
d37eab2
100644
(file)
--- 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]));
}