Browse Source

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>
v2.0.2
Nick Raienko 10 years ago
committed by Jeremiah Senkpiel
parent
commit
e55fdc47a7
  1. 6
      doc/api/util.markdown

6
doc/api/util.markdown

@ -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.

Loading…
Cancel
Save