summaryrefslogtreecommitdiff
path: root/lib/os.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2016-12-04 12:47:01 -0800
committerJames M Snell <jasnell@gmail.com>2017-01-30 11:11:57 -0800
commit5de3cf099cd01c84d1809dab90c041b76aa58d8e (patch)
tree91b2e748d3050058167c69daaf29b0a57245bec1 /lib/os.js
parent03e89b3ff298c63e9620f1547094f7fca76edde7 (diff)
downloadandroid-node-v8-5de3cf099cd01c84d1809dab90c041b76aa58d8e.tar.gz
android-node-v8-5de3cf099cd01c84d1809dab90c041b76aa58d8e.tar.bz2
android-node-v8-5de3cf099cd01c84d1809dab90c041b76aa58d8e.zip
lib: add static identifier codes for all deprecations
Assigns a static identifier code to all runtime and documentation only deprecations. The identifier code is included in the emitted DeprecationWarning. Also adds a deprecations.md to the API docs to provide a central location where deprecation codes can be referenced and explained. PR-URL: https://github.com/nodejs/node/pull/10116 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michal Zasso <targos@protonmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'lib/os.js')
-rw-r--r--lib/os.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/os.js b/lib/os.js
index a59cc49bae..7ab0ec5fa4 100644
--- a/lib/os.js
+++ b/lib/os.js
@@ -53,12 +53,14 @@ exports.tmpdir = function() {
const tmpDirDeprecationMsg =
'os.tmpDir() is deprecated. Use os.tmpdir() instead.';
-exports.tmpDir = internalUtil.deprecate(exports.tmpdir, tmpDirDeprecationMsg);
+exports.tmpDir = internalUtil.deprecate(exports.tmpdir,
+ tmpDirDeprecationMsg,
+ 'DEP0022');
exports.getNetworkInterfaces = internalUtil.deprecate(function() {
return exports.networkInterfaces();
}, 'os.getNetworkInterfaces is deprecated. ' +
- 'Use os.networkInterfaces instead.');
+ 'Use os.networkInterfaces instead.', 'DEP0023');
exports.EOL = isWindows ? '\r\n' : '\n';