Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Issue 2646593002: [intl] Fall back on an invalid default locale to "und" (Closed)

Created:
3 years, 11 months ago by Dan Ehrenberg
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[intl] Fall back on an invalid default locale to "und" The default locale can be changed in some environments with environment variables. These environment variables used to allow the system to get into an invalid state, where the default locale was unsupported. This patch detects that case and falls back to "und" as the default locale if there is an Intl service which does not support the locale that ICU reports as the default. It also has a slight cleanup of surrounding code. I haven't gone through the work to set up an automated test, as triggering the case requires setting environment variables, which our tests don't tend to do, but I tested interactively as follows: dehrenberg@dehrenberg:~/v8/v8$ LC_ALL="tlh-FR" rlwrap out/Release/d8 V8 version 5.7.0 (candidate) d8> new Intl.NumberFormat("foo").resolvedOptions().locale "und" d8> new Intl.NumberFormat().resolvedOptions().locale "und" d8> dehrenberg@dehrenberg:~/v8/v8$ LC_ALL="de" rlwrap out/Release/d8 V8 version 5.7.0 (candidate) d8> new Intl.NumberFormat().resolvedOptions().locale "de" d8> new Intl.NumberFormat("foo").resolvedOptions().locale "de" d8> BUG=v8:4216 Review-Url: https://codereview.chromium.org/2646593002 Cr-Commit-Position: refs/heads/master@{#43253} Committed: https://chromium.googlesource.com/v8/v8/+/3059138b20bb56918cce24003832442c0ad701fa

Patch Set 1 #

Total comments: 2

Patch Set 2 : [intl] Fall back on an invalid default locale to "und" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -11 lines) Patch
M src/js/i18n.js View 1 5 chunks +19 lines, -11 lines 0 comments Download

Messages

Total messages: 27 (16 generated)
Dan Ehrenberg
3 years, 11 months ago (2017-01-18 20:29:26 UTC) #4
jungshik at Google
I have to think about this a bit more. Below is my initial response. https://codereview.chromium.org/2646593002/diff/1/src/js/i18n.js ...
3 years, 11 months ago (2017-01-19 19:16:22 UTC) #7
Dan Ehrenberg
https://codereview.chromium.org/2646593002/diff/1/src/js/i18n.js File src/js/i18n.js (right): https://codereview.chromium.org/2646593002/diff/1/src/js/i18n.js#newcode159 src/js/i18n.js:159: DEFAULT_ICU_LOCALE = "en"; On 2017/01/19 19:16:22, jungshik at Google ...
3 years, 10 months ago (2017-02-10 08:54:28 UTC) #11
jungshik at Google
LGTM. Thanks. Just to make sure, have you tried formatting numbers and date when the ...
3 years, 10 months ago (2017-02-15 18:37:58 UTC) #14
Dan Ehrenberg
On 2017/02/15 18:37:58, jungshik at Google wrote: > LGTM. Thanks. > > Just to make ...
3 years, 10 months ago (2017-02-15 18:47:45 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2646593002/20001
3 years, 10 months ago (2017-02-15 18:47:58 UTC) #17
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 10 months ago (2017-02-15 18:48:00 UTC) #19
Dan Ehrenberg
Yang, could you take a look?
3 years, 10 months ago (2017-02-15 18:52:57 UTC) #21
Yang
On 2017/02/15 18:52:57, Dan Ehrenberg wrote: > Yang, could you take a look? lgtm.
3 years, 10 months ago (2017-02-16 14:13:01 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2646593002/20001
3 years, 10 months ago (2017-02-16 14:15:36 UTC) #24
commit-bot: I haz the power
3 years, 10 months ago (2017-02-16 14:41:09 UTC) #27
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/v8/v8/+/3059138b20bb56918cce24003832442c0ad...

Powered by Google App Engine
This is Rietveld 408576698