Skip to content
Permalink
Browse files

src: add intl and icu configs to process.binding('config')

PR-URL: #6266
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
jasnell committed Apr 19, 2016
1 parent 2e974cd commit cdba9a6c02ba3418feacaefa575d02fab0eb594b
Showing with 20 additions and 1 deletion.
  1. +13 −1 src/node_config.cc
  2. +4 −0 src/node_i18n.cc
  3. +3 −0 src/node_i18n.h
@@ -1,4 +1,5 @@
#include "node.h"
#include "node_i18n.h"
#include "env.h"
#include "env-inl.h"
#include "util.h"
@@ -28,7 +29,18 @@ using v8::ReadOnly;
void InitConfig(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
// Environment* env = Environment::GetCurrent(context);
Environment* env = Environment::GetCurrent(context);

#ifdef NODE_HAVE_I18N_SUPPORT
READONLY_BOOLEAN_PROPERTY("hasIntl");

#ifdef NODE_HAVE_SMALL_ICU
READONLY_BOOLEAN_PROPERTY("hasSmallICU");
#endif // NODE_HAVE_SMALL_ICU

if (flag_icu_data_dir)
READONLY_BOOLEAN_PROPERTY("usingICUDataDir");
#endif // NODE_HAVE_I18N_SUPPORT
}

} // namespace node
@@ -42,10 +42,14 @@ extern "C" const char U_DATA_API SMALL_ICUDATA_ENTRY_POINT[];
#endif

namespace node {

bool flag_icu_data_dir = false;

namespace i18n {

bool InitializeICUDirectory(const char* icu_data_path) {
if (icu_data_path != nullptr) {
flag_icu_data_dir = true;
u_setDataDirectory(icu_data_path);
return true; // no error
} else {
@@ -6,6 +6,9 @@
#if defined(NODE_HAVE_I18N_SUPPORT)

namespace node {

extern bool flag_icu_data_dir;

namespace i18n {

bool InitializeICUDirectory(const char* icu_data_path);

1 comment on commit cdba9a6

@trevnorris

This comment has been minimized.

Copy link
Contributor

commented on cdba9a6 Apr 26, 2016

Why wasn't this squashed with the previous one?

Please sign in to comment.
You can’t perform that action at this time.