From 39a2ac4c6ba189fd1596572655dbd6c8daff2d5f Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 26 Dec 2018 19:43:15 +0800 Subject: 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 Reviewed-By: James M Snell Reviewed-By: Minwoo Jung --- src/node_config.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/node_config.cc') diff --git a/src/node_config.cc b/src/node_config.cc index edf738b633..7204e24656 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -26,6 +26,18 @@ static void Initialize(Local target, Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); +#if defined(DEBUG) && DEBUG + READONLY_TRUE_PROPERTY(target, "isDebugBuild"); +#else + READONLY_FALSE_PROPERTY(target, "isDebugBuild"); +#endif // defined(DEBUG) && DEBUG + +#if HAVE_OPENSSL + READONLY_TRUE_PROPERTY(target, "hasOpenSSL"); +#else + READONLY_FALSE_PROPERTY(target, "hasOpenSSL"); +#endif // HAVE_OPENSSL + #ifdef NODE_FIPS_MODE READONLY_TRUE_PROPERTY(target, "fipsMode"); // TODO(addaleax): Use options parser variable instead. -- cgit v1.2.3