mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibJS: Implement Temporal.Now[@@toStringTag]
This commit is contained in:
parent
b3723a88a6
commit
ff307194f3
2 changed files with 7 additions and 1 deletions
|
@ -24,8 +24,11 @@ void Now::initialize(GlobalObject& global_object)
|
|||
Object::initialize(global_object);
|
||||
|
||||
auto& vm = this->vm();
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
||||
// 2.1.1 Temporal.Now [ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal-now-@@tostringtag
|
||||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Temporal.Now"), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.timeZone, time_zone, 0, attr);
|
||||
define_native_function(vm.names.instant, instant, 0, attr);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
test("basic functionality", () => {
|
||||
expect(Temporal.Now[Symbol.toStringTag]).toBe("Temporal.Now");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue