Bug 1884553: Correctly handle modified array iterator state. r=mgaudet
[gecko.git] / js / src / tests / non262 / Temporal / PlainDate / from-with-modified-array-iterator-state.js
blobac0febc1e644e3093376b29e8bef2d2a46226bbd
1 // |reftest| skip-if(!this.hasOwnProperty("Temporal"))
3 const ArrayIteratorPrototype = Object.getPrototypeOf([][Symbol.iterator]());
5 // Modify the ArrayIteratorPrototype prototype chain to disable optimisations.
6 Object.setPrototypeOf(ArrayIteratorPrototype, {});
8 let calendar = new Temporal.Calendar("iso8601");
10 let dateLike = {
11   calendar,
12   day: 1,
13   month: 1,
14   year: 0,
17 let result = Temporal.PlainDate.from(dateLike);
19 assertEq(result.toString(), "0000-01-01");
21 if (typeof reportCompare === "function")
22   reportCompare(true, true);