diff options
author | James M Snell <jasnell@gmail.com> | 2017-02-17 15:42:21 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-02-19 15:06:39 -0800 |
commit | 051047231ec71307302904b10dd8a80ee3027ae0 (patch) | |
tree | 0aa4c58a713305ad322e948fd174c3fdbf03901b /lib/internal/util.js | |
parent | fcf3cbed281118598751c7c71c5323963f61c5dc (diff) | |
download | android-node-v8-051047231ec71307302904b10dd8a80ee3027ae0.tar.gz android-node-v8-051047231ec71307302904b10dd8a80ee3027ae0.tar.bz2 android-node-v8-051047231ec71307302904b10dd8a80ee3027ae0.zip |
util: cleanup internalUtil.deprecate
There were two functions `deprecate` and `_deprecate`
that were really just aliases of each other. Simplify
PR-URL: https://github.com/nodejs/node/pull/11450
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/internal/util.js')
-rw-r--r-- | lib/internal/util.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/internal/util.js b/lib/internal/util.js index 4470770a99..5c47d06d58 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -10,12 +10,6 @@ const kDecoratedPrivateSymbolIndex = binding['decorated_private_symbol']; // `util` module makes it accessible without having to `require('util')` there. exports.customInspectSymbol = Symbol('util.inspect.custom'); -// All the internal deprecations have to use this function only, as this will -// prepend the prefix to the actual message. -exports.deprecate = function(fn, msg, code) { - return exports._deprecate(fn, msg, code); -}; - exports.trace = function(msg) { console.trace(`${prefix}${msg}`); }; @@ -23,11 +17,11 @@ exports.trace = function(msg) { // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. -exports._deprecate = function(fn, msg, code) { +exports.deprecate = function deprecate(fn, msg, code) { // Allow for deprecating things in the process of starting up. if (global.process === undefined) { return function() { - return exports._deprecate(fn, msg).apply(this, arguments); + return exports.deprecate(fn, msg, code).apply(this, arguments); }; } |