mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Add test for 12.4.21 of Temporal (#3036)
* Add test for 12.4.21 of Temporal 12.4.21 Temporal.Calendar.prototype.fields ( fields ) https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.fields @sffc @Ms2ger @ryzokuken @ljharb * move to the right file * remove from wrong place
This commit is contained in:
parent
356afd79a8
commit
f1f3a2d542
27
test/built-ins/Temporal/Calendar/prototype/fields/long-input.js
vendored
Normal file
27
test/built-ins/Temporal/Calendar/prototype/fields/long-input.js
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2021 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.calendar.prototype.fields
|
||||||
|
description: Temporal.Calendar.prototype.fields will take iterable of any size and any string
|
||||||
|
and return Array of the same content.
|
||||||
|
info: |
|
||||||
|
## 12.4.21 Temporal.Calendar.prototype.fields ( fields )
|
||||||
|
1. Let calendar be the this value.
|
||||||
|
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||||
|
3. Assert: calendar.[[Identifier]] is "iso8601".
|
||||||
|
4. Let fieldNames be ? IterableToListOfType(fields, « String »).
|
||||||
|
5. Return ! CreateArrayFromList(fieldNames).
|
||||||
|
features: [Temporal]
|
||||||
|
includes: [compareArray.js]
|
||||||
|
---*/
|
||||||
|
let cal = new Temporal.Calendar("iso8601")
|
||||||
|
const fields = {
|
||||||
|
*[Symbol.iterator]() {
|
||||||
|
let i = 0;
|
||||||
|
while (i++ < 1000001) {
|
||||||
|
yield "garbage " + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(compareArray(cal.fields(fields), Array.from(fields)));
|
Loading…
x
Reference in New Issue
Block a user