summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-19 20:18:01 +0300
committerLinus Groh <mail@linusgroh.de>2021-10-20 12:27:19 +0100
commit20163c058485dc524402c46f21bbe65a860bf9c5 (patch)
tree35e6942b65f8138ee073efcec6dae987d9ab0377 /Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
parent3355b52cca1e1a8478ea5dbbd193120af4c83ca6 (diff)
downloadserenity-20163c058485dc524402c46f21bbe65a860bf9c5.zip
LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
index 3a71cae95f..a17c4befb5 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
@@ -273,7 +273,7 @@ Value PromiseConstructor::construct(FunctionObject& new_target)
}
// 27.2.4.1 Promise.all ( iterable ), https://tc39.es/ecma262/#sec-promise.all
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::all)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::all)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -302,7 +302,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::all)
}
// 27.2.4.2 Promise.allSettled ( iterable ), https://tc39.es/ecma262/#sec-promise.allsettled
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::all_settled)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::all_settled)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -331,7 +331,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::all_settled)
}
// 27.2.4.3 Promise.any ( iterable ), https://tc39.es/ecma262/#sec-promise.any
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::any)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::any)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -360,7 +360,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::any)
}
// 27.2.4.5 Promise.race ( iterable ), https://tc39.es/ecma262/#sec-promise.race
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::race)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::race)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -389,7 +389,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::race)
}
// 27.2.4.6 Promise.reject ( r ), https://tc39.es/ecma262/#sec-promise.reject
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::reject)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::reject)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
auto promise_capability = new_promise_capability(global_object, constructor);
@@ -401,7 +401,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::reject)
}
// 27.2.4.7 Promise.resolve ( x ), https://tc39.es/ecma262/#sec-promise.resolve
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::resolve)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::resolve)
{
auto* constructor = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
auto value = vm.argument(0);
@@ -409,7 +409,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::resolve)
}
// 27.2.4.8 get Promise [ @@species ], https://tc39.es/ecma262/#sec-get-promise-@@species
-JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::symbol_species_getter)
+JS_DEFINE_OLD_NATIVE_FUNCTION(PromiseConstructor::symbol_species_getter)
{
return vm.this_value(global_object);
}