mirror of https://github.com/nodejs/node.git
doc: fix util.deprecate example
PR-URL: https://github.com/iojs/io.js/pull/1535 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Julian Duque <julianduquej@gmail.com>pull/1535/merge
parent
2a3c8c187e
commit
e55fdc47a7
|
@ -438,11 +438,13 @@ through the `constructor.super_` property.
|
|||
|
||||
Marks that a method should not be used any more.
|
||||
|
||||
exports.puts = exports.deprecate(function() {
|
||||
var util = require('util');
|
||||
|
||||
exports.puts = util.deprecate(function() {
|
||||
for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||
process.stdout.write(arguments[i] + '\n');
|
||||
}
|
||||
}, 'util.puts: Use console.log instead')
|
||||
}, 'util.puts: Use console.log instead');
|
||||
|
||||
It returns a modified function which warns once by default.
|
||||
|
||||
|
|
Loading…
Reference in New Issue