diff --git a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..62086da857 --- /dev/null +++ b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.compare +description: > + A Temporal.TimeZone instance passed to compare() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Duration.compare(new Temporal.Duration(), new Temporal.Duration(), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }); +Temporal.Duration.compare(new Temporal.Duration(), new Temporal.Duration(), { relativeTo: { year: 2000, month: 5, day: 2, timeZone: { timeZone } } }); diff --git a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..643acc2572 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.add +description: > + A Temporal.TimeZone instance passed to add() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Duration(1); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.add(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }); +instance.add(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone: { timeZone } } }); diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..0f0cb9ff21 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + A Temporal.TimeZone instance passed to round() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Duration(1); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.round({ largestUnit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }); +instance.round({ largestUnit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone: { timeZone } } }); diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..b4a92890a5 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.subtract +description: > + A Temporal.TimeZone instance passed to subtract() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Duration(1); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.subtract(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }); +instance.subtract(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone: { timeZone } } }); diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..2ca7ed5f55 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.total +description: > + A Temporal.TimeZone instance passed to total() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Duration(1); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.total({ unit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }); +instance.total({ unit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone: { timeZone } } }); diff --git a/test/built-ins/Temporal/Instant/prototype/toString/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Instant/prototype/toString/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..54e6309bc3 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toString/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tostring +description: > + A Temporal.TimeZone instance passed to toString() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(0n); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toString({ timeZone }); +instance.toString({ timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..9d171db011 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tozoneddatetime +description: > + A Temporal.TimeZone instance passed to toZonedDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(0n); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toZonedDateTime({ timeZone, calendar: "iso8601" }); +instance.toZonedDateTime({ timeZone: { timeZone }, calendar: "iso8601" }); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..0753643e2a --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tozoneddatetimeiso +description: > + A Temporal.TimeZone instance passed to toZonedDateTimeISO() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(0n); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toZonedDateTimeISO(timeZone); +instance.toZonedDateTimeISO({ timeZone }); diff --git a/test/built-ins/Temporal/Now/plainDate/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/plainDate/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..36bf9b2cb1 --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDate/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindate +description: > + A Temporal.TimeZone instance passed to plainDate() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.plainDate("iso8601", timeZone); +Temporal.Now.plainDate("iso8601", { timeZone }); diff --git a/test/built-ins/Temporal/Now/plainDateISO/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/plainDateISO/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..fdb608b647 --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDateISO/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindateiso +description: > + A Temporal.TimeZone instance passed to plainDateISO() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.plainDateISO(timeZone); +Temporal.Now.plainDateISO({ timeZone }); diff --git a/test/built-ins/Temporal/Now/plainDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/plainDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..dcc4274edf --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindatetime +description: > + A Temporal.TimeZone instance passed to plainDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.plainDateTime("iso8601", timeZone); +Temporal.Now.plainDateTime("iso8601", { timeZone }); diff --git a/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..3eb8199497 --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindatetimeiso +description: > + A Temporal.TimeZone instance passed to plainDateTimeISO() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.plainDateTimeISO(timeZone); +Temporal.Now.plainDateTimeISO({ timeZone }); diff --git a/test/built-ins/Temporal/Now/plainTimeISO/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/plainTimeISO/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..e49afec915 --- /dev/null +++ b/test/built-ins/Temporal/Now/plainTimeISO/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaintimeiso +description: > + A Temporal.TimeZone instance passed to plainTimeISO() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.plainTimeISO(timeZone); +Temporal.Now.plainTimeISO({ timeZone }); diff --git a/test/built-ins/Temporal/Now/zonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/zonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..73a27dd9f2 --- /dev/null +++ b/test/built-ins/Temporal/Now/zonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.zoneddatetime +description: > + A Temporal.TimeZone instance passed to zonedDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.zonedDateTime("iso8601", timeZone); +Temporal.Now.zonedDateTime("iso8601", { timeZone }); diff --git a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..e65094d5e2 --- /dev/null +++ b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.zoneddatetimeiso +description: > + A Temporal.TimeZone instance passed to zonedDateTimeISO() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.Now.zonedDateTimeISO(timeZone); +Temporal.Now.zonedDateTimeISO({ timeZone }); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..6a69b6ca7e --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: > + A Temporal.TimeZone instance passed to toZonedDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(2000, 5, 2); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toZonedDateTime(timeZone); +instance.toZonedDateTime({ timeZone }); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..f9f6a4ede1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tozoneddatetime +description: > + A Temporal.TimeZone instance passed to toZonedDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(2000, 5, 2); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toZonedDateTime(timeZone); +instance.toZonedDateTime({ timeZone }); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..75ecf010fd --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: > + A Temporal.TimeZone instance passed to toZonedDateTime() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.PlainTime(); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone }); +instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/TimeZone/from/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/TimeZone/from/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..38f519b518 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/from/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.from +description: > + A Temporal.TimeZone instance passed to from() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.TimeZone.from(timeZone); +Temporal.TimeZone.from({ timeZone }); diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..0a2b360ac5 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,23 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.compare +description: > + A Temporal.TimeZone instance passed to compare() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +const arg1 = { year: 2020, month: 5, day: 2, timeZone }; +Temporal.ZonedDateTime.compare(arg1, arg1); + +const arg2 = { year: 2020, month: 5, day: 2, timeZone: { timeZone } }; +Temporal.ZonedDateTime.compare(arg2, arg2); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..b8edbb9bd5 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.from +description: > + A Temporal.TimeZone instance passed to from() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }); +Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..092ee494ea --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.equals +description: > + A Temporal.TimeZone instance passed to equals() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.equals({ year: 2020, month: 5, day: 2, timeZone }); +instance.equals({ year: 2020, month: 5, day: 2, timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..dc1b28d6d6 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + A Temporal.TimeZone instance passed to since() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.since({ year: 2020, month: 5, day: 2, timeZone }); +instance.since({ year: 2020, month: 5, day: 2, timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..f38e636c65 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + A Temporal.TimeZone instance passed to until() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.until({ year: 2020, month: 5, day: 2, timeZone }); +instance.until({ year: 2020, month: 5, day: 2, timeZone: { timeZone } }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..2bd86e7e5b --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,22 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withtimezone +description: > + A Temporal.TimeZone instance passed to withTimeZone() does not have its + 'timeZone' property observably checked +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +instance.withTimeZone(timeZone); +instance.withTimeZone({ timeZone }); diff --git a/test/built-ins/Temporal/ZonedDateTime/timezone-instance-does-not-get-timeZone-property.js b/test/built-ins/Temporal/ZonedDateTime/timezone-instance-does-not-get-timeZone-property.js new file mode 100644 index 0000000000..c91da6c755 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/timezone-instance-does-not-get-timeZone-property.js @@ -0,0 +1,20 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime +description: > + A Temporal.TimeZone instance passed to new ZonedDateTime() does not have + its 'timeZone' property observably checked +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +Object.defineProperty(timeZone, "timeZone", { + get() { + throw new Test262Error("timeZone.timeZone should not be accessed"); + }, +}); + +new Temporal.ZonedDateTime(0n, timeZone); +new Temporal.ZonedDateTime(0n, { timeZone });