Backed out 3 changesets (bug 1901078, bug 1749048) for causing interface related...
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainMonthDay / prototype / toPlainDate / not-a-constructor.js
blobcab2fc3623fe07db99e55be02013cd6108945f92
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-temporal.plainmonthday.prototype.toplaindate
7 description: >
8   Temporal.PlainMonthDay.prototype.toPlainDate does not implement [[Construct]], is not new-able
9 info: |
10     Built-in function objects that are not identified as constructors do not implement the
11     [[Construct]] internal method unless otherwise specified in the description of a particular
12     function.
13 includes: [isConstructor.js]
14 features: [Reflect.construct, Temporal]
15 ---*/
17 assert.throws(TypeError, () => {
18   new Temporal.PlainMonthDay.prototype.toPlainDate();
19 }, "Calling as constructor");
21 assert.sameValue(isConstructor(Temporal.PlainMonthDay.prototype.toPlainDate), false,
22   "isConstructor(Temporal.PlainMonthDay.prototype.toPlainDate)");
24 reportCompare(0, 0);