diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 72b35ea2ca..1ee4935338 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -18,6 +18,11 @@ InstantPrototype::InstantPrototype(GlobalObject& global_object) void InstantPrototype::initialize(GlobalObject& global_object) { Object::initialize(global_object); + + auto& vm = this->vm(); + + // 8.3.2 Temporal.Instant.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype-@@tostringtag + define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Temporal.Instant"), Attribute::Configurable); } } diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.@@toStringTag.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.@@toStringTag.js new file mode 100644 index 0000000000..a6e1187c84 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.@@toStringTag.js @@ -0,0 +1,3 @@ +test("basic functionality", () => { + expect(Temporal.Instant.prototype[Symbol.toStringTag]).toBe("Temporal.Instant"); +});