Skip to content

Commit

Permalink
LibJS: Implement Temporal.Duration.prototype[@@toStringTag]
Browse files Browse the repository at this point in the history
  • Loading branch information
linusg committed Jul 16, 2021
1 parent 7921d8b commit 23766f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ DurationPrototype::DurationPrototype(GlobalObject& global_object)
void DurationPrototype::initialize(GlobalObject& 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);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test("basic functionality", () => {
expect(Temporal.Duration.prototype[Symbol.toStringTag]).toBe("Temporal.Duration");
});

0 comments on commit 23766f2

Please sign in to comment.