Internationalization API: LocaleList removal

# Norbert Lindenberg (13 years ago)

At the TC 39 meeting on May 21, we decided to remove LocaleList from the Internationalization API because its primary purpose is performance and we don't have evidence that there actually is a performance problem requiring this solution.

One side effect of removing LocaleList from the API is that the object returned from the supportedLocalesOf methods is now a simple Array, and therefore is modifiable. This probably prevents us from ever switching the return value of these methods back to a LocaleList, whose LocaleList properties (length and indexed elements 0..length-1) are immutable.

I don't think that's a big concern, but wanted to bring it to everybody's attention in case somebody does have concerns.

Norbert

# Andreas Rossberg (13 years ago)

On 25 June 2012 19:00, Norbert Lindenberg <ecmascript at norbertlindenberg.com> wrote:

One side effect of removing LocaleList from the API is that the object returned from the supportedLocalesOf methods is now a simple Array, and therefore is modifiable. This probably prevents us from ever switching the return value of these methods back to a LocaleList, whose LocaleList properties (length and indexed elements 0..length-1) are immutable.

Well, I don't see a reason why you couldn't return a frozen array then.

# Norbert Lindenberg (13 years ago)

Good idea. A frozen array is more restrictive than a LocaleList (which is extensible), but that's probably OK in this context. Or we could thaw it a bit...

Norbert

# Allen Wirfs-Brock (13 years ago)

On Jun 25, 2012, at 3:36 PM, Norbert Lindenberg wrote:

Good idea. A frozen array is more restrictive than a LocaleList (which is extensible), but that's probably OK in this context. Or we could thaw it a bit...

Right, if you wanted to be less restrictive (more like the way LocaleList was spec'ed) you could just make the array elements and the length property non-writable/non-configurable.

# Rick Waldron (13 years ago)

On Mon, Jun 25, 2012 at 6:36 PM, Norbert Lindenberg < ecmascript at norbertlindenberg.com> wrote:

Good idea. A frozen array is more restrictive than a LocaleList (which is extensible), but that's probably OK in this context. Or we could thaw it a bit...

I was thinking the same thing, but was curious about potential performance issues of large frozen arrays, but based on the small amount of research I did today, there is a slight performance improvement when using a frozen array.