archives

« Bugzilla Issues Index

#1274 — Document ECMA-402 overrides of locale-sensitive functions


The first edition of ECMA-402, ECMAScript Internationalization API Specification, provides specifications for several locale-sensitive functions that supersede specifications in ECMA-262. The second edition is adding to that set.

The ECMA-262 specifications of these functions should have language referring to ECMA-402.

For
- String.prototype.localeCompare
- Number.prototype.toLocaleString
- Date.prototype.toLocaleString
- Date.prototype.toLocaleDateString
- Date.prototype.toLocaleTimeString

"Implementations that also implement standard ECMA-402, ECMAScript Internationalization API Specification, must follow the specification provided in that standard."

For
- String.prototype.toLocaleLowerCase
- String.prototype.toLocaleUpperCase
and likely
- Object.prototype.toLocaleString
- Array.prototype.toLocaleString

"Implementations that also implement the second edition of standard ECMA-402, ECMAScript Internationalization API Specification, must follow the specification provided in that standard."

The current notes warning that the first or second "parameter to this function is likely to be used in a future version of this standard" should be replaced in all functions that have them with:

"The first and second [for localeCompare: second and third] parameters to this function are used in the version described in standard ECMA-402, ECMAScript Internationalization API Specification. Implementations must not use these parameter positions in ways other than described in that specification."


fixed in rev20 editor's draft

also see the conformance cluase


fixed in rev20 draft, Oct. 28, 2013


Checked in rev 26 draft:

- The specs for the functions respecified in the first edition of ECMA-402 look good.

- The specs for the functions that are candidates for respecification in the second edition of ECMA-402 are incomplete, but then development of that second edition itself has not progressed to a point where it's clear what ECMA-262 can say about it:

-- The specs for String.prototype.toLocaleLowerCase and String.prototype.toLocaleUpperCase say nothing about ECMA-402. The most recent draft of the second edition of ECMA-402 has specifications for them:
http://norbertlindenberg.com/ecmascript/intl.html#sec-13.1.2

-- The spec for Array.prototype.toLocaleString shows the optional arguments, requires that an implementation with the internationalization API "must implement the Array.prototype.toLocaleString method as specified in the ECMA-402 specification", but notes that "the first edition of ECMA-402 did not include a replacement specification". The most recent draft of the second edition still does not.

-- The spec for Object.prototype.toLocaleString shows the optional arguments, notes that they "are not used but may be passed by inplementations that include ECMA-402 support" and that ECMA-402 "intentionally does not provide an alternative to this default implementation". That reflects the outcome of a discussion on es-discuss, but hasn't been confirmed by the internationalization ad-hoc yet. The spec also stutters "the the".

-- The spec for %TypedArray%.prototype.toLocaleString states that its initial value "is the same built-in function object as the Array.prototype.toLocaleString method". This sounds about right, but it's not immediately clear that the elements will have Number.prototype.toLocaleString called on them.

This needs to be looked at again together with bug 1260, bug 573, and bug 2383.


fixed in rev36 editor's draft


in rev36