-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Correct definition order of properties on PlainDateTime.ge…
…tISOFields object This was intended to be alphabetical. See: #1508
- Loading branch information
Showing
7 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
polyfill/test/PlainDate/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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.plaindate.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoDay", | ||
"isoMonth", | ||
"isoYear", | ||
]; | ||
|
||
const date = new Temporal.PlainDate(2000, 5, 2); | ||
const result = date.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
26 changes: 26 additions & 0 deletions
26
polyfill/test/PlainDateTime/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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.plaindatetime.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoDay", | ||
"isoHour", | ||
"isoMicrosecond", | ||
"isoMillisecond", | ||
"isoMinute", | ||
"isoMonth", | ||
"isoNanosecond", | ||
"isoSecond", | ||
"isoYear", | ||
]; | ||
|
||
const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); | ||
const result = datetime.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
20 changes: 20 additions & 0 deletions
20
polyfill/test/PlainMonthDay/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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.plainmonthday.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoDay", | ||
"isoMonth", | ||
"isoYear", | ||
]; | ||
|
||
const md = new Temporal.PlainMonthDay(5, 2); | ||
const result = md.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
23 changes: 23 additions & 0 deletions
23
polyfill/test/PlainTime/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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.plaintime.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoHour", | ||
"isoMicrosecond", | ||
"isoMillisecond", | ||
"isoMinute", | ||
"isoNanosecond", | ||
"isoSecond", | ||
]; | ||
|
||
const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); | ||
const result = time.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
20 changes: 20 additions & 0 deletions
20
polyfill/test/PlainYearMonth/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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.plainyearmonth.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoDay", | ||
"isoMonth", | ||
"isoYear", | ||
]; | ||
|
||
const ym = new Temporal.PlainYearMonth(2000, 5); | ||
const result = ym.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
28 changes: 28 additions & 0 deletions
28
polyfill/test/ZonedDateTime/prototype/getISOFields/field-traversal-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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.zoneddatetime.prototype.getisofields | ||
description: Properties added in correct order to object returned from getISOFields | ||
includes: [compareArray.js] | ||
---*/ | ||
|
||
const expected = [ | ||
"calendar", | ||
"isoDay", | ||
"isoHour", | ||
"isoMicrosecond", | ||
"isoMillisecond", | ||
"isoMinute", | ||
"isoMonth", | ||
"isoNanosecond", | ||
"isoSecond", | ||
"isoYear", | ||
"offset", | ||
"timeZone", | ||
]; | ||
|
||
const datetime = new Temporal.ZonedDateTime(1_000_086_400_987_654_321n, "UTC"); | ||
const result = datetime.getISOFields(); | ||
|
||
assert.compareArray(Object.keys(result), expected); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters