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
Nick Raienko 2015-04-27 18:04:11 +03:00 committed by Jeremiah Senkpiel
parent 2a3c8c187e
commit e55fdc47a7
1 changed files with 4 additions and 2 deletions

View File

@ -438,11 +438,13 @@ through the `constructor.super_` property.
Marks that a method should not be used any more. 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) { for (var i = 0, len = arguments.length; i < len; ++i) {
process.stdout.write(arguments[i] + '\n'); 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. It returns a modified function which warns once by default.