Closed Bug 1653291 Opened 3 months ago Closed 2 months ago

Make "locales" and "options" arguments and the "type" property mandatory for Intl.DisplayNames


(Core :: JavaScript: Internationalization API, task, P2)




Tracking Status
firefox80 --- fixed


(Reporter: anba, Assigned: anba)



(4 files)

Make "locales" and "options" arguments and the "type" property mandatory for Intl.DisplayNames per the latest spec proposal changes. Also canonicalise the input arguments to the of() method.

Severity: -- → N/A
Priority: -- → P2

Moves the fallback handling from JS into C++ code, because the language, script,
and region tags were already canonicalised in C++, so handling the fallback path
in C++ altogether avoids repeated canonicalisation.

Change Intl_DisplayNames_of to call ToString(code) before getDisplayNamesInternals()
following comments from a previous review.

"month" is the only date-time type which may return an empty string (only for
Undecimber, though). Handle this case and also assert all other date-time types
always return a non-empty result.

Depends on D83944

Zero initialisation is cheap for this case (two mov for script and a single
mov for region types).

Depends on D83945

Drive-by change:
Enable now passing test262 tests which weren't updated in the last test262 update.

Depends on D83946

Pushed by
Part 1: Canonicalise input arguments to Intl.DisplayNames.p.of(). r=jwalden
Part 2: Canonicalise "month" for Intl.DisplayNames. r=jwalden
Part 3: Zero initialise the script and region char arrays. r=jwalden
Part 4: Require 'locales' and 'options' arguments. r=jwalden
You need to log in before you can comment on or make changes to this bug.