From 5de3cf099cd01c84d1809dab90c041b76aa58d8e Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 4 Dec 2016 12:47:01 -0800 Subject: 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 Reviewed-By: Michal Zasso Reviewed-By: Fedor Indutny --- lib/os.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/os.js') 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'; -- cgit v1.2.3