Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary dup GetOption in DateTimeFormat to sync ECMA402PR709 #3879

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,13 @@
/*---
esid: sec-initializedatetimeformat
description: Checks the order of getting options of 'dayPeriod' for the DateTimeFormat constructor.
info: |
ToDateTimeOptions ( options, required, defaults )
4. If required is "date" or "any", then
a. For each of the property names "weekday", "year", "month", "day", "dayPeriod" do
5. If required is "time" or "any", then
a. For each of the property names "hour", "minute", "second", do
includes: [compareArray.js]
features: [Intl.DateTimeFormat-dayPeriod]

---*/

// Just need to ensure dayPeriod are get between day and hour.
const expected = [
// ToDateTimeOptions step 4.
"day", "dayPeriod",
// ToDateTimeOptions step 5.
"hour",
// InitializeDateTimeFormat step 22.
"day",
"dayPeriod",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
esid: sec-initializedatetimeformat
description: Checks the order of getting options of 'fractionalSecondDigits' for the DateTimeFormat constructor.
info: |
ToDateTimeOptions ( options, required, defaults )
5. If required is "time" or "any", then
a. For each of the property names "hour", "minute", "second", "fractionalSecondDigits", do

InitializeDateTimeFormat ( dateTimeFormat, locales, options )
2. Let options be ? ToDateTimeOptions(options, "any", "date").
4. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
22. For each row of Table 5, except the header row, do
a. Let value be ? GetOption(options, prop, "string", « the strings given in the Values column of the row », undefined).
Expand All @@ -25,9 +20,6 @@ features: [Intl.DateTimeFormat-fractionalSecondDigits]
// between second and localeMatcher the first time and
// between timeZoneName and formatMatcher the second time.
const expected = [
// InitializeDateTimeFormat step 2.
// ToDateTimeOptions step 5.
"second", "fractionalSecondDigits",
// InitializeDateTimeFormat step 4.
"localeMatcher",
// InitializeDateTimeFormat step 22.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ features: [Intl.DateTimeFormat-datetimestyle]
// To be merged into constructor-options-order.js when the feature is removed.

const expected = [
// ToDateTimeOptions step 4.
"weekday", "year", "month", "day",
// ToDateTimeOptions step 5.
"hour", "minute", "second",
// ToDateTimeOptions step 6.
"dateStyle",
// ToDateTimeOptions step 7.
"timeStyle",

// InitializeDateTimeFormat step 4.
"localeMatcher",
// InitializeDateTimeFormat step 6.
Expand Down
5 changes: 0 additions & 5 deletions test/intl402/DateTimeFormat/constructor-options-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ includes: [compareArray.js]
---*/

const expected = [
// ToDateTimeOptions step 4.
"weekday", "year", "month", "day",
// ToDateTimeOptions step 5.
"hour", "minute", "second",

// InitializeDateTimeFormat step 4.
"localeMatcher",
// InitializeDateTimeFormat step 6.
Expand Down