Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7271cb0

Browse filesBrowse files
evanlucasjasnell
authored andcommitted
src: add process.versions.icu
If i18n support is present, add the icu version to process.versions Fixes: #3089 PR-URL: #3102 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent f638402 commit 7271cb0
Copy full SHA for 7271cb0

File tree

Expand file treeCollapse file tree

3 files changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/process.markdown‎

Copy file name to clipboardExpand all lines: doc/api/process.markdown
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ Will print something like:
648648
zlib: '1.2.8',
649649
ares: '1.10.0-DEV',
650650
modules: '43',
651+
icu: '55.1',
651652
openssl: '1.0.1k' }
652653

653654
## process.config
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
#include <string.h>
5353
#include <sys/types.h>
5454

55+
#if defined(NODE_HAVE_I18N_SUPPORT)
56+
#include <unicode/uvernum.h>
57+
#endif
58+
5559
#if defined(LEAK_SANITIZER)
5660
#include <sanitizer/lsan_interface.h>
5761
#endif
@@ -2681,6 +2685,12 @@ void SetupProcessObject(Environment* env,
26812685
"ares",
26822686
FIXED_ONE_BYTE_STRING(env->isolate(), ARES_VERSION_STR));
26832687

2688+
#if defined(NODE_HAVE_I18N_SUPPORT) && defined(U_ICU_VERSION)
2689+
READONLY_PROPERTY(versions,
2690+
"icu",
2691+
OneByteString(env->isolate(), U_ICU_VERSION));
2692+
#endif
2693+
26842694
const char node_modules_version[] = NODE_STRINGIFY(NODE_MODULE_VERSION);
26852695
READONLY_PROPERTY(
26862696
versions,
Collapse file

‎test/parallel/test-process-versions.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-versions.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ if (common.hasCrypto) {
99
expected_keys.push('openssl');
1010
}
1111

12+
if (typeof Intl !== 'undefined') {
13+
expected_keys.push('icu');
14+
}
15+
1216
assert.deepEqual(Object.keys(process.versions).sort(), expected_keys.sort());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.