LibJS: Implement Temporal.PlainMonthDay.prototype[@@toStringTag]

This commit is contained in:
Linus Groh 2021-08-14 23:56:38 +01:00
parent 0cf526d0c4
commit 37b5a0715e
Notes: sideshowbarker 2024-07-18 05:41:58 +09:00
2 changed files with 8 additions and 0 deletions
Userland/Libraries/LibJS
Runtime/Temporal
Tests/builtins/Temporal/PlainMonthDay

View file

@ -18,6 +18,11 @@ PlainMonthDayPrototype::PlainMonthDayPrototype(GlobalObject& global_object)
void PlainMonthDayPrototype::initialize(GlobalObject& global_object)
{
Object::initialize(global_object);
auto& vm = this->vm();
// 10.3.2 Temporal.PlainMonthDay.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday.prototype-@@tostringtag
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainMonthDay"), Attribute::Configurable);
}
}

View file

@ -0,0 +1,3 @@
test("basic functionality", () => {
expect(Temporal.PlainMonthDay.prototype[Symbol.toStringTag]).toBe("Temporal.PlainMonthDay");
});