2021-09-29 21:48:22 +02:00
|
|
|
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
2022-02-01 11:58:02 +01:00
|
|
|
esid: sec-temporal.plainyearmonth.compare
|
2021-09-29 21:48:22 +02:00
|
|
|
description: compare() ignores the observable properties and uses internal slots
|
|
|
|
features: [Temporal]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function CustomError() {}
|
|
|
|
|
|
|
|
class AvoidGettersYearMonth extends Temporal.PlainYearMonth {
|
|
|
|
get year() {
|
|
|
|
throw new CustomError();
|
|
|
|
}
|
|
|
|
get month() {
|
|
|
|
throw new CustomError();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const one = new AvoidGettersYearMonth(2000, 5);
|
|
|
|
const two = new AvoidGettersYearMonth(2006, 3);
|
|
|
|
assert.sameValue(Temporal.PlainYearMonth.compare(one, two), -1);
|