mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 01:40:46 +00:00
LibJS: Implement Temporal.Duration.prototype[@@toStringTag]
This commit is contained in:
parent
7921d8ba91
commit
23766f28db
Notes:
sideshowbarker
2024-07-18 08:58:12 +09:00
Author: https://github.com/linusg
Commit: 23766f28db
Pull-request: https://github.com/SerenityOS/serenity/pull/8794
Reviewed-by: https://github.com/IdanHo ✅
2 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,11 @@ DurationPrototype::DurationPrototype(GlobalObject& global_object)
|
||||||
void DurationPrototype::initialize(GlobalObject& global_object)
|
void DurationPrototype::initialize(GlobalObject& global_object)
|
||||||
{
|
{
|
||||||
Object::initialize(global_object);
|
Object::initialize(global_object);
|
||||||
|
|
||||||
|
auto& vm = this->vm();
|
||||||
|
|
||||||
|
// 7.3.2 Temporal.Duration.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype-@@tostringtag
|
||||||
|
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Temporal.Duration"), Attribute::Configurable);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
test("basic functionality", () => {
|
||||||
|
expect(Temporal.Duration.prototype[Symbol.toStringTag]).toBe("Temporal.Duration");
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue