src: default --icu_case_mapping on as a v8 option
* toLocaleUpperCase() and toLocaleLowerCase() do not function properly without this flag. * basic test case. The test case would fail if `--no_icu_case_mapping` was set. Fixes: https://github.com/nodejs/node/issues/9445 PR-URL: https://github.com/nodejs/node/pull/9454 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
15b83b967a
commit
1a55e9a567
@ -4191,6 +4191,14 @@ void Init(int* argc,
|
|||||||
DispatchDebugMessagesAsyncCallback));
|
DispatchDebugMessagesAsyncCallback));
|
||||||
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_debug_messages_async));
|
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_debug_messages_async));
|
||||||
|
|
||||||
|
#if defined(NODE_HAVE_I18N_SUPPORT)
|
||||||
|
// Set the ICU casing flag early
|
||||||
|
// so the user can disable a flag --foo at run-time by passing
|
||||||
|
// --no_foo from the command line.
|
||||||
|
const char icu_case_mapping[] = "--icu_case_mapping";
|
||||||
|
V8::SetFlagsFromString(icu_case_mapping, sizeof(icu_case_mapping) - 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(NODE_V8_OPTIONS)
|
#if defined(NODE_V8_OPTIONS)
|
||||||
// Should come before the call to V8::SetFlagsFromCommandLine()
|
// Should come before the call to V8::SetFlagsFromCommandLine()
|
||||||
// so the user can disable a flag --foo at run-time by passing
|
// so the user can disable a flag --foo at run-time by passing
|
||||||
|
@ -50,6 +50,11 @@ if (!common.hasIntl) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check casing
|
||||||
|
{
|
||||||
|
assert.strictEqual('I'.toLocaleLowerCase('tr'), 'ı');
|
||||||
|
}
|
||||||
|
|
||||||
// Check with toLocaleString
|
// Check with toLocaleString
|
||||||
{
|
{
|
||||||
const localeString = dtf.format(date0);
|
const localeString = dtf.format(date0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user