diff options
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/locales-undefined.js')
-rw-r--r-- | js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/locales-undefined.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/locales-undefined.js b/js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/locales-undefined.js new file mode 100644 index 0000000000..a111b53390 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/locales-undefined.js @@ -0,0 +1,21 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2021 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tolocalestring +description: Omitting the locales argument defaults to the DateTimeFormat default +features: [BigInt, Temporal] +---*/ + +const instant = new Temporal.Instant(957270896_987_650_000n); +const defaultFormatter = new Intl.DateTimeFormat([], Object.create(null)); +const expected = defaultFormatter.format(instant); + +const actualExplicit = instant.toLocaleString(undefined); +assert.sameValue(actualExplicit, expected, "default locale is determined by Intl.DateTimeFormat"); + +const actualImplicit = instant.toLocaleString(); +assert.sameValue(actualImplicit, expected, "default locale is determined by Intl.DateTimeFormat"); + +reportCompare(0, 0); |