mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
LibJS: Add @@toStringTag to Promise.prototype
This commit is contained in:
parent
ed64a69fb2
commit
b377777208
2 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
test("basic functionality", () => {
|
||||
expect(Promise.prototype[Symbol.toStringTag]).toBe("Promise");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue