src: add process.versions.icu
If i18n support is present, add the icu version to process.versions Fixes: https://github.com/nodejs/node/issues/3089 PR-URL: https://github.com/nodejs/node/pull/3102 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
parent
20dae2a906
commit
30b8bb0aab
@ -648,6 +648,7 @@ Will print something like:
|
|||||||
zlib: '1.2.8',
|
zlib: '1.2.8',
|
||||||
ares: '1.10.0-DEV',
|
ares: '1.10.0-DEV',
|
||||||
modules: '43',
|
modules: '43',
|
||||||
|
icu: '55.1',
|
||||||
openssl: '1.0.1k' }
|
openssl: '1.0.1k' }
|
||||||
|
|
||||||
## process.config
|
## process.config
|
||||||
|
10
src/node.cc
10
src/node.cc
@ -52,6 +52,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#if defined(NODE_HAVE_I18N_SUPPORT)
|
||||||
|
#include <unicode/uvernum.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(LEAK_SANITIZER)
|
#if defined(LEAK_SANITIZER)
|
||||||
#include <sanitizer/lsan_interface.h>
|
#include <sanitizer/lsan_interface.h>
|
||||||
#endif
|
#endif
|
||||||
@ -2669,6 +2673,12 @@ void SetupProcessObject(Environment* env,
|
|||||||
"ares",
|
"ares",
|
||||||
FIXED_ONE_BYTE_STRING(env->isolate(), ARES_VERSION_STR));
|
FIXED_ONE_BYTE_STRING(env->isolate(), ARES_VERSION_STR));
|
||||||
|
|
||||||
|
#if defined(NODE_HAVE_I18N_SUPPORT) && defined(U_ICU_VERSION)
|
||||||
|
READONLY_PROPERTY(versions,
|
||||||
|
"icu",
|
||||||
|
OneByteString(env->isolate(), U_ICU_VERSION));
|
||||||
|
#endif
|
||||||
|
|
||||||
const char node_modules_version[] = NODE_STRINGIFY(NODE_MODULE_VERSION);
|
const char node_modules_version[] = NODE_STRINGIFY(NODE_MODULE_VERSION);
|
||||||
READONLY_PROPERTY(
|
READONLY_PROPERTY(
|
||||||
versions,
|
versions,
|
||||||
|
@ -9,4 +9,8 @@ if (common.hasCrypto) {
|
|||||||
expected_keys.push('openssl');
|
expected_keys.push('openssl');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof Intl !== 'undefined') {
|
||||||
|
expected_keys.push('icu');
|
||||||
|
}
|
||||||
|
|
||||||
assert.deepEqual(Object.keys(process.versions).sort(), expected_keys.sort());
|
assert.deepEqual(Object.keys(process.versions).sort(), expected_keys.sort());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user