Skip to content

Commit 1f334cd

Browse files
committed
Bug 1799859: Add support for "microsecond" and "nanosecond" units. r=dminor
Steps performed: - Add "microsecond" and "nanosecond" to "intl/icu/data_filter.json". - Run "icu_sources_data.py" to update the ICU data file. - Run "update-tzdata.sh" to reapply the tzdata 2022f changes. - Add "microsecond" and "nanosecond" to "SanctionedSimpleUnitIdentifiers.yaml". - Run "make_intl_data.py units" to regenerate additional SpiderMonkey files. Spec PR: tc39/ecma402#708 Differential Revision: https://phabricator.services.mozilla.com/D161676
1 parent 962de84 commit 1f334cd

9 files changed

+18
-0
lines changed

config/external/icu/data/icudt71l.dat

32.2 KB
Binary file not shown.

intl/components/src/MeasureUnitGenerated.h

+2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ inline constexpr SimpleMeasureUnit simpleMeasureUnits[] = {
4242
{"digital", "megabit"},
4343
{"digital", "megabyte"},
4444
{"length", "meter"},
45+
{"duration", "microsecond"},
4546
{"length", "mile"},
4647
{"length", "mile-scandinavian"},
4748
{"volume", "milliliter"},
4849
{"length", "millimeter"},
4950
{"duration", "millisecond"},
5051
{"duration", "minute"},
5152
{"duration", "month"},
53+
{"duration", "nanosecond"},
5254
{"mass", "ounce"},
5355
{"concentr", "percent"},
5456
{"digital", "petabyte"},

intl/icu/data_filter.json

+2
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@
9292
"+/*/digital/megabit",
9393
"+/*/digital/megabyte",
9494
"+/*/length/meter",
95+
"+/*/duration/microsecond",
9596
"+/*/length/mile",
9697
"+/*/length/mile-scandinavian",
9798
"+/*/volume/milliliter",
9899
"+/*/length/millimeter",
99100
"+/*/duration/millisecond",
100101
"+/*/duration/minute",
101102
"+/*/duration/month",
103+
"+/*/duration/nanosecond",
102104
"+/*/mass/ounce",
103105
"+/*/concentr/percent",
104106
"+/*/digital/petabyte",

js/src/builtin/intl/SanctionedSimpleUnitIdentifiers.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
- megabit
3737
- megabyte
3838
- meter
39+
- microsecond
3940
- mile
4041
- mile-scandinavian
4142
- milliliter
4243
- millimeter
4344
- millisecond
4445
- minute
4546
- month
47+
- nanosecond
4648
- ounce
4749
- percent
4850
- petabyte

js/src/builtin/intl/SanctionedSimpleUnitIdentifiersGenerated.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/tests/jstests.list

+4
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ skip script test262/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-d
651651
skip script test262/built-ins/Date/year-zero.js
652652
skip script test262/built-ins/Date/parse/year-zero.js
653653

654+
# Local test262 copy not yet updated for https://github.com/tc39/test262/pull/3713
655+
skip script test262/intl402/Intl/supportedValuesOf/units.js
656+
skip script test262/intl402/NumberFormat/prototype/format/units-invalid.js
657+
654658

655659
##############################################
656660
# Enable Iterator Helpers tests in the shell #

js/src/tests/non262/Intl/NumberFormat/unit-compound-combinations.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ const sanctionedSimpleUnitIdentifiers = [
2828
"megabit",
2929
"megabyte",
3030
"meter",
31+
"microsecond",
3132
"mile",
3233
"mile-scandinavian",
3334
"milliliter",
3435
"millimeter",
3536
"millisecond",
3637
"minute",
3738
"month",
39+
"nanosecond",
3840
"ounce",
3941
"percent",
4042
"petabyte",

js/src/tests/non262/Intl/NumberFormat/unit-formatToParts-has-unit-field.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ const sanctionedSimpleUnitIdentifiers = [
2828
"megabit",
2929
"megabyte",
3030
"meter",
31+
"microsecond",
3132
"mile",
3233
"mile-scandinavian",
3334
"milliliter",
3435
"millimeter",
3536
"millisecond",
3637
"minute",
3738
"month",
39+
"nanosecond",
3840
"ounce",
3941
"percent",
4042
"petabyte",

js/src/tests/non262/Intl/NumberFormat/unit-well-formed.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ const sanctionedSimpleUnitIdentifiers = [
2828
"megabit",
2929
"megabyte",
3030
"meter",
31+
"microsecond",
3132
"mile",
3233
"mile-scandinavian",
3334
"milliliter",
3435
"millimeter",
3536
"millisecond",
3637
"minute",
3738
"month",
39+
"nanosecond",
3840
"ounce",
3941
"percent",
4042
"petabyte",

0 commit comments

Comments
 (0)