summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRod Vagg <rod@vagg.org>2018-04-16 16:51:56 +1000
committerRich Trott <rtrott@gmail.com>2018-04-20 10:28:38 -0700
commit287ec1e8f434098a32e99d6778a826aae6f9c165 (patch)
tree9c9edf5bb9e0e29e52324aa919816de34a5c59b4 /lib
parent53822f605d3171530ab820d71e8832f473479c27 (diff)
downloadandroid-node-v8-287ec1e8f434098a32e99d6778a826aae6f9c165.tar.gz
android-node-v8-287ec1e8f434098a32e99d6778a826aae6f9c165.tar.bz2
android-node-v8-287ec1e8f434098a32e99d6778a826aae6f9c165.zip
Revert "process: add version constants and compare"
This reverts commit 91e0f8db118b125e805a77ce31dc21af57ee7abf. PR-URL: https://github.com/nodejs/node/pull/20062 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap/node.js1
-rw-r--r--lib/internal/process.js44
2 files changed, 1 insertions, 44 deletions
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index b74c194d07..7762aac846 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -35,7 +35,6 @@
setupGlobalVariables();
const _process = NativeModule.require('internal/process');
- _process.setupCompareVersion();
_process.setupConfig(NativeModule._source);
_process.setupSignalHandlers();
_process.setupUncaughtExceptionCapture(exceptionHandlerState);
diff --git a/lib/internal/process.js b/lib/internal/process.js
index 027657991a..f72043264f 100644
--- a/lib/internal/process.js
+++ b/lib/internal/process.js
@@ -283,47 +283,6 @@ function setupUncaughtExceptionCapture(exceptionHandlerState) {
};
}
-function setupCompareVersion() {
- const {
- majorVersion,
- minorVersion,
- patchVersion,
- prereleaseTag,
- } = process.release;
-
- process.release.compareVersion = (major, minor, patch, tag) => {
- if (typeof major !== 'number')
- throw new ERR_INVALID_ARG_TYPE('major', 'number', major);
- if (typeof minor !== 'number')
- throw new ERR_INVALID_ARG_TYPE('minor', 'number', minor);
- if (typeof patch !== 'number')
- throw new ERR_INVALID_ARG_TYPE('patch', 'number', patch);
- if (tag !== undefined && typeof tag !== 'string')
- throw new ERR_INVALID_ARG_TYPE('tag', 'string', tag);
-
- if (major > majorVersion)
- return -1;
- if (major < majorVersion)
- return 1;
-
- if (minor > minorVersion)
- return -1;
- if (minor < minorVersion)
- return 1;
-
- if (patch > patchVersion)
- return -1;
- if (patch < patchVersion)
- return 1;
- if (prereleaseTag)
- return prereleaseTag === tag ? 0 : 1;
- if (tag)
- return -1;
-
- return 0;
- };
-}
-
module.exports = {
setup_performance,
setup_cpuUsage,
@@ -334,6 +293,5 @@ module.exports = {
setupSignalHandlers,
setupChannel,
setupRawDebug,
- setupUncaughtExceptionCapture,
- setupCompareVersion,
+ setupUncaughtExceptionCapture
};