summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Temporal/PlainDate/from-with-modified-array-iterator-state.js
blob: ac0febc1e644e3093376b29e8bef2d2a46226bbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// |reftest| skip-if(!this.hasOwnProperty("Temporal"))

const ArrayIteratorPrototype = Object.getPrototypeOf([][Symbol.iterator]());

// Modify the ArrayIteratorPrototype prototype chain to disable optimisations.
Object.setPrototypeOf(ArrayIteratorPrototype, {});

let calendar = new Temporal.Calendar("iso8601");

let dateLike = {
  calendar,
  day: 1,
  month: 1,
  year: 0,
};

let result = Temporal.PlainDate.from(dateLike);

assertEq(result.toString(), "0000-01-01");

if (typeof reportCompare === "function")
  reportCompare(true, true);