1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// Copyright 2019 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializedatetimeformat
description: >
Checks the order of getting "calendar" and "numberingSystem" options in the
DateTimeFormat is between "localeMatcher" and "hour12" options.
info: |
4. Let _matcher_ be ? GetOption(_options_, `"localeMatcher"`, `"string"`, « `"lookup"`, `"best fit"` », `"best fit"`).
...
6. Let _calendar_ be ? GetOption(_options_, `"calendar"`, `"string"`, *undefined*, *undefined*).
...
9. Let _numberingSystem_ be ? GetOption(_options_, `"numberingSystem"`, `"string"`, *undefined*, *undefined*).
...
12. Let _hour12_ be ? GetOption(_options_, `"hour12"`, `"boolean"`, *undefined*, *undefined*).
includes: [compareArray.js]
---*/
const actual = [];
const options = {
get localeMatcher() {
actual.push("localeMatcher");
return undefined;
},
get calendar() {
actual.push("calendar");
return undefined;
},
get numberingSystem() {
actual.push("numberingSystem");
return undefined;
},
get hour12() {
actual.push("hour12");
return undefined;
},
};
const expected = [
"localeMatcher",
"calendar",
"numberingSystem",
"hour12"
];
let df = new Intl.DateTimeFormat(undefined, options);
assert.compareArray(actual, expected);
reportCompare(0, 0);
|