LibJS: Add @@toStringTag to Promise.prototype

This commit is contained in:
Linus Groh 2021-06-08 19:11:53 +01:00
parent ed64a69fb2
commit b377777208
Notes: sideshowbarker 2024-07-18 12:36:37 +09:00
2 changed files with 4 additions and 0 deletions

View file

@ -29,6 +29,7 @@ void PromisePrototype::initialize(GlobalObject& global_object)
define_native_function(vm.names.then, then, 2, attr);
define_native_function(vm.names.catch_, catch_, 1, attr);
define_native_function(vm.names.finally, finally, 1, attr);
define_property(vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Promise"), Attribute::Configurable);
}
static Promise* promise_from(VM& vm, GlobalObject& global_object)

View file

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