src: initialize ICU version in per_process::metadata.versions
Instead of
- Initialize the ICU versions in JS land after consulting
internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
each of the keys
Do:
- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
and put them in per_process::metadata.versions. These will be
copied into `process.versions` naturally later.
This way, the initialization of the versions won't be called
in worker threads again.
PR-URL: https://github.com/nodejs/node/pull/25115
Reviewed-By:
Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By:
Richard Lau <riclau@uk.ibm.com>
Reviewed-By:
Minwoo Jung <minwoo@nodesource.com>
Reviewed-By:
James M Snell <jasnell@gmail.com>
parent
a29c93a1
Please register or sign in to comment