Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add process.versions.icu #3102

Merged
merged 1 commit into from
Sep 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ Will print something like:
zlib: '1.2.8',
ares: '1.10.0-DEV',
modules: '43',
icu: '55.1',
openssl: '1.0.1k' }

## process.config
Expand Down
10 changes: 10 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#include <string.h>
#include <sys/types.h>

#if defined(NODE_HAVE_I18N_SUPPORT)
#include <unicode/uvernum.h>
#endif

#if defined(LEAK_SANITIZER)
#include <sanitizer/lsan_interface.h>
#endif
Expand Down Expand Up @@ -2669,6 +2673,12 @@ void SetupProcessObject(Environment* env,
"ares",
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);
READONLY_PROPERTY(
versions,
Expand Down
4 changes: 4 additions & 0 deletions test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ if (common.hasCrypto) {
expected_keys.push('openssl');
}

if (typeof Intl !== 'undefined') {
expected_keys.push('icu');
}

assert.deepEqual(Object.keys(process.versions).sort(), expected_keys.sort());