author | André Bargull <andre.bargull@gmail.com> |
Tue, 14 Feb 2017 15:06:24 -0800 | |
changeset 343080 | edf262601235c770b8f1638dd75180bc7935ce38 |
parent 343079 | 0429b0b495da0839e459b0713e9a39adbd60386f |
child 343081 | 3a90f1f64d8d8cb6fa4aae7e0a322e69671636ae |
push id | 31369 |
push user | kwierso@gmail.com |
push date | Thu, 16 Feb 2017 00:18:40 +0000 |
treeherder | mozilla-central@e9b926463f9e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Waldo |
bugs | 1339621 |
milestone | 54.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/builtin/Intl.cpp | file | annotate | diff | comparison | revisions | |
js/src/builtin/Intl.js | file | annotate | diff | comparison | revisions |
--- a/js/src/builtin/Intl.cpp +++ b/js/src/builtin/Intl.cpp @@ -1124,16 +1124,22 @@ js::intl_availableCollations(JSContext* return false; } RootedObject collations(cx, NewDenseEmptyArray(cx)); if (!collations) 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)) { JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR); return false; } // Per ECMA-402, 10.2.3, we don't include standard and search:
--- a/js/src/builtin/Intl.js +++ b/js/src/builtin/Intl.js @@ -1601,20 +1601,18 @@ var collatorInternalProperties = { addSpecialMissingLanguageTags(locales); return (this._availableLocales = locales); }, relevantExtensionKeys: ["co", "kn"] }; function collatorSortLocaleData(locale) { - var collations = intl_availableCollations(locale); - callFunction(std_Array_unshift, collations, null); return { - co: collations, + co: intl_availableCollations(locale), kn: ["false", "true"] }; } function collatorSearchLocaleData(locale) { return { co: [null],