mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1339621: Directly add default null collation instead of shifting all elements with unshift(). r=Waldo
--HG-- extra : rebase_source : 46109d27755b7a94d1992d65c2bcb965ca276405
This commit is contained in:
parent
264673d83e
commit
06c6a5f7dd
@ -1129,6 +1129,12 @@ js::intl_availableCollations(JSContext* cx, unsigned argc, Value* vp)
|
||||
return false;
|
||||
|
||||
uint32_t index = 0;
|
||||
|
||||
// The first element of the collations array must be |null| per
|
||||
// ES2017 Intl, 10.2.3 Internal Slots.
|
||||
if (!DefineElement(cx, collations, index++, NullHandleValue))
|
||||
return false;
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
const char* collation = uenum_next(values, nullptr, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
|
@ -1606,10 +1606,8 @@ var collatorInternalProperties = {
|
||||
|
||||
|
||||
function collatorSortLocaleData(locale) {
|
||||
var collations = intl_availableCollations(locale);
|
||||
callFunction(std_Array_unshift, collations, null);
|
||||
return {
|
||||
co: collations,
|
||||
co: intl_availableCollations(locale),
|
||||
kn: ["false", "true"]
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user