diff options
author | Sakthipriyan Vairamani <thechargingvolcano@gmail.com> | 2015-06-13 16:44:39 +0000 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2015-07-03 16:32:29 +0200 |
commit | 9cd44bb2b683446531306bbcff8739fc3526d02c (patch) | |
tree | 54a52ca88eb414d8025608f7d87df9a58e99be2f /lib/_stream_writable.js | |
parent | d55a778bae2188a24b2cb1f1006cf7cc09432649 (diff) | |
download | android-node-v8-9cd44bb2b683446531306bbcff8739fc3526d02c.tar.gz android-node-v8-9cd44bb2b683446531306bbcff8739fc3526d02c.tar.bz2 android-node-v8-9cd44bb2b683446531306bbcff8739fc3526d02c.zip |
util: prepend '(node) ' to deprecation messages
Changes included in this commit are
1. Making the deprecation messages consistent. The messages will be in
the following format
x is deprecated. Use y instead.
If there is no alternative for `x`, then the ` Use y instead.` part
will not be there in the message.
2. All the internal deprecation messages are printed with the prefix
`(node) `, except when the `--trace-deprecation` flag is set.
Fixes: https://github.com/nodejs/io.js/issues/1883
PR-URL: https://github.com/nodejs/io.js/pull/1892
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'lib/_stream_writable.js')
-rw-r--r-- | lib/_stream_writable.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 5b374688b0..19c0c8a006 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -8,6 +8,7 @@ module.exports = Writable; Writable.WritableState = WritableState; const util = require('util'); +const internalUtil = require('internal/util'); const Stream = require('stream'); const Buffer = require('buffer').Buffer; @@ -120,10 +121,10 @@ WritableState.prototype.getBuffer = function writableStateGetBuffer() { }; Object.defineProperty(WritableState.prototype, 'buffer', { - get: util.deprecate(function() { + get: internalUtil.deprecate(function() { return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + + 'instead.') }); function Writable(options) { |