tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit e7c39a3bb9376c3b2f145f30890edb121d66c2b2
parent 75a44f40d93800a03853b245e4c5bb32ac23de2d
Author: André Bargull <andre.bargull@gmail.com>
Date:   Tue, 16 Dec 2025 18:23:28 +0000

Bug 2005531 - Part 7: Remove no longer used self-hosting code. r=spidermonkey-reviewers,dminor

Differential Revision: https://phabricator.services.mozilla.com/D276025

Diffstat:
Mjs/src/builtin/intl/Collator.js | 20--------------------
Mjs/src/builtin/intl/CommonFunctions.js | 76----------------------------------------------------------------------------
Mjs/src/builtin/intl/DateTimeFormat.js | 20--------------------
Mjs/src/builtin/intl/DisplayNames.js | 18------------------
Mjs/src/builtin/intl/DurationFormat.js | 18------------------
Mjs/src/builtin/intl/ListFormat.js | 18------------------
Mjs/src/builtin/intl/NumberFormat.js | 22----------------------
Mjs/src/builtin/intl/PluralRules.js | 22----------------------
Mjs/src/builtin/intl/RelativeTimeFormat.js | 20--------------------
Mjs/src/builtin/intl/Segmenter.js | 20--------------------
10 files changed, 0 insertions(+), 254 deletions(-)

diff --git a/js/src/builtin/intl/Collator.js b/js/src/builtin/intl/Collator.js @@ -247,26 +247,6 @@ function InitializeCollator(collator, locales, options) { } /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript Internationalization API Specification, 10.2.2. - */ -function Intl_Collator_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "Collator"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * Collator internal properties. * * Spec: ECMAScript Internationalization API Specification, 9.1 and 10.2.3. diff --git a/js/src/builtin/intl/CommonFunctions.js b/js/src/builtin/intl/CommonFunctions.js @@ -564,82 +564,6 @@ function addUnicodeExtension(locale, extension) { } /** - * Returns the subset of requestedLocales for which availableLocales has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript Internationalization API Specification, 9.2.7. - */ -function LookupSupportedLocales(availableLocales, requestedLocales) { - // Step 1. - var subset = []; - - // Step 2. - for (var i = 0; i < requestedLocales.length; i++) { - var locale = requestedLocales[i]; - - // Step 2.a. - var noExtensionsLocale = removeUnicodeExtensions(locale); - - // Step 2.b. - var availableLocale = BestAvailableLocale( - availableLocales, - noExtensionsLocale - ); - - // Step 2.c. - if (availableLocale !== undefined) { - DefineDataProperty(subset, subset.length, locale); - } - } - - // Step 3. - return subset; -} - -/** - * Returns the subset of requestedLocales for which availableLocales has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript Internationalization API Specification, 9.2.8. - */ -function BestFitSupportedLocales(availableLocales, requestedLocales) { - // don't have anything better - return LookupSupportedLocales(availableLocales, requestedLocales); -} - -/** - * Returns the subset of requestedLocales for which availableLocales has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript Internationalization API Specification, 9.2.9. - */ -function SupportedLocales(availableLocales, requestedLocales, options) { - // Step 1. - var matcher; - if (options !== undefined) { - // Step 1.a. - options = ToObject(options); - - // Step 1.b - matcher = options.localeMatcher; - if (matcher !== undefined) { - matcher = ToString(matcher); - if (matcher !== "lookup" && matcher !== "best fit") { - ThrowRangeError(JSMSG_INVALID_LOCALE_MATCHER, matcher); - } - } - } - - // Steps 2-5. - return matcher === undefined || matcher === "best fit" - ? BestFitSupportedLocales(availableLocales, requestedLocales) - : LookupSupportedLocales(availableLocales, requestedLocales); -} - -/** * Extracts a property value from the provided options object, converts it to * the required type, checks whether it is one of a list of allowed values, * and fills in a fallback value if necessary. diff --git a/js/src/builtin/intl/DateTimeFormat.js b/js/src/builtin/intl/DateTimeFormat.js @@ -615,26 +615,6 @@ function InitializeDateTimeFormat( /* eslint-enable complexity */ /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript Internationalization API Specification, 12.3.2. - */ -function Intl_DateTimeFormat_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "DateTimeFormat"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * DateTimeFormat internal properties. * * Spec: ECMAScript Internationalization API Specification, 9.1 and 12.3.3. diff --git a/js/src/builtin/intl/DisplayNames.js b/js/src/builtin/intl/DisplayNames.js @@ -307,24 +307,6 @@ function InitializeDisplayNames(displayNames, locales, options, mozExtensions) { } /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - */ -function Intl_DisplayNames_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "DisplayNames"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * Returns the resolved options for a DisplayNames object. */ function Intl_DisplayNames_of(code) { diff --git a/js/src/builtin/intl/DurationFormat.js b/js/src/builtin/intl/DurationFormat.js @@ -520,24 +520,6 @@ function GetDurationUnitOptions( } /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - */ -function Intl_DurationFormat_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "DurationFormat"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * Returns the resolved options for a DurationFormat object. */ function Intl_DurationFormat_resolvedOptions() { diff --git a/js/src/builtin/intl/ListFormat.js b/js/src/builtin/intl/ListFormat.js @@ -176,24 +176,6 @@ function InitializeListFormat(listFormat, locales, options) { } /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - */ -function Intl_ListFormat_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "ListFormat"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * StringListFromIterable ( iterable ) */ function StringListFromIterable(iterable, methodName) { diff --git a/js/src/builtin/intl/NumberFormat.js b/js/src/builtin/intl/NumberFormat.js @@ -924,28 +924,6 @@ function CurrencyDigits(currency) { return 2; } -/** - * 15.2.2 Intl.NumberFormat.supportedLocalesOf ( locales [ , options ] ) - * - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * ES2024 Intl draft rev 74ca7099f103d143431b2ea422ae640c6f43e3e6 - */ -function Intl_NumberFormat_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "NumberFormat"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - function getNumberingSystems(locale) { // ICU doesn't have an API to determine the set of numbering systems // supported for a locale; it generally pretends that any numbering system diff --git a/js/src/builtin/intl/PluralRules.js b/js/src/builtin/intl/PluralRules.js @@ -230,28 +230,6 @@ function InitializePluralRules(pluralRules, locales, options) { } /** - * 16.2.2 Intl.PluralRules.supportedLocalesOf ( locales [ , options ] ) - * - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * ES2024 Intl draft rev 74ca7099f103d143431b2ea422ae640c6f43e3e6 - */ -function Intl_PluralRules_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "PluralRules"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * 16.3.3 Intl.PluralRules.prototype.select ( value ) * * Returns a String value representing the plural category matching diff --git a/js/src/builtin/intl/RelativeTimeFormat.js b/js/src/builtin/intl/RelativeTimeFormat.js @@ -198,26 +198,6 @@ function InitializeRelativeTimeFormat(relativeTimeFormat, locales, options) { } /** - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - * - * Spec: ECMAScript 402 API, RelativeTimeFormat, 1.3.2. - */ -function Intl_RelativeTimeFormat_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "RelativeTimeFormat"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * Returns a String value representing the written form of a relative date * formatted according to the effective locale and the formatting options * of this RelativeTimeFormat object. diff --git a/js/src/builtin/intl/Segmenter.js b/js/src/builtin/intl/Segmenter.js @@ -159,26 +159,6 @@ function InitializeSegmenter(segmenter, locales, options) { } /** - * Intl.Segmenter.supportedLocalesOf ( locales [, options ]) - * - * Returns the subset of the given locale list for which this locale list has a - * matching (possibly fallback) locale. Locales appear in the same order in the - * returned list as in the input list. - */ -function Intl_Segmenter_supportedLocalesOf(locales /*, options*/) { - var options = ArgumentsLength() > 1 ? GetArgument(1) : undefined; - - // Step 1. - var availableLocales = "Segmenter"; - - // Step 2. - var requestedLocales = CanonicalizeLocaleList(locales); - - // Step 3. - return SupportedLocales(availableLocales, requestedLocales, options); -} - -/** * Intl.Segmenter.prototype.segment ( string ) * * Create a new Segments object.