From e55fdc47a7420e81ca0ddec5449839b43382bea3 Mon Sep 17 00:00:00 2001 From: Nick Raienko Date: Mon, 27 Apr 2015 18:04:11 +0300 Subject: [PATCH] doc: fix util.deprecate example PR-URL: https://github.com/iojs/io.js/pull/1535 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Evan Lucas Reviewed-By: Julian Duque --- doc/api/util.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/util.markdown b/doc/api/util.markdown index 77d9a8f..8ac1582 100644 --- a/doc/api/util.markdown +++ b/doc/api/util.markdown @@ -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. -- 2.7.4