summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-26 19:43:15 +0800
committerAnna Henningsen <anna@addaleax.net>2018-12-31 01:20:33 +0100
commit39a2ac4c6ba189fd1596572655dbd6c8daff2d5f (patch)
treebabeb14a208175426eb6bb137d880332677dc670 /lib
parent6c7c77ef05a04ffa5532056f8a1ea44a946c2014 (diff)
downloadandroid-node-v8-39a2ac4c6ba189fd1596572655dbd6c8daff2d5f.tar.gz
android-node-v8-39a2ac4c6ba189fd1596572655dbd6c8daff2d5f.tar.bz2
android-node-v8-39a2ac4c6ba189fd1596572655dbd6c8daff2d5f.zip
process: move process.features initialization into node.js
Use `internalBinding('config')` to shim the legacy `process.features`. PR-URL: https://github.com/nodejs/node/pull/25239 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap/node.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 3c14d4851a..c709635a75 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -270,6 +270,24 @@ function startup() {
'process.assert() is deprecated. Please use the `assert` module instead.',
'DEP0100');
+ // TODO(joyeecheung): this property has not been well-maintained, should we
+ // deprecate it in favor of a better API?
+ const { isDebugBuild, hasOpenSSL } = internalBinding('config');
+ Object.defineProperty(process, 'features', {
+ enumerable: true,
+ writable: false,
+ configurable: false,
+ value: {
+ debug: isDebugBuild,
+ uv: true,
+ ipv6: true, // TODO(bnoordhuis) ping libuv
+ tls_alpn: hasOpenSSL,
+ tls_sni: hasOpenSSL,
+ tls_ocsp: hasOpenSSL,
+ tls: hasOpenSSL
+ }
+ });
+
const perf = internalBinding('performance');
const {
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,