Welcome! Log In Create A New Profile

Advanced

[njs] Renaming promise to promise_ctor to avoid confusion.

Dmitry Volyntsev
June 15, 2022 08:14PM
details: https://hg.nginx.org/njs/rev/461b1a030acb
branches:
changeset: 1889:461b1a030acb
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Tue Jun 14 17:48:54 2022 -0700
description:
Renaming promise to promise_ctor to avoid confusion.

diffstat:

src/njs_promise.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)

diffs (67 lines):

diff -r c6522ba4bd53 -r 461b1a030acb src/njs_promise.c
--- a/src/njs_promise.c Sat Jun 11 00:15:49 2022 -0700
+++ b/src/njs_promise.c Tue Jun 14 17:48:54 2022 -0700
@@ -1242,18 +1242,18 @@ njs_promise_all(njs_vm_t *vm, njs_value_
njs_index_t function_type)
{
njs_int_t ret;
- njs_value_t *promise, resolve;
+ njs_value_t *promise_ctor, resolve;
njs_iterator_handler_t handler;
njs_promise_iterator_args_t pargs;

- promise = njs_argument(args, 0);
+ promise_ctor = njs_argument(args, 0);

- pargs.capability = njs_promise_new_capability(vm, promise);
+ pargs.capability = njs_promise_new_capability(vm, promise_ctor);
if (njs_slow_path(pargs.capability == NULL)) {
return NJS_ERROR;
}

- ret = njs_value_property(vm, promise, njs_value_arg(&string_resolve),
+ ret = njs_value_property(vm, promise_ctor, njs_value_arg(&string_resolve),
&resolve);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
@@ -1265,7 +1265,7 @@ njs_promise_all(njs_vm_t *vm, njs_value_
}

pargs.function = njs_function(&resolve);
- pargs.constructor = promise;
+ pargs.constructor = promise_ctor;

switch (function_type) {
case NJS_PROMISE_ALL_SETTLED:
@@ -1702,18 +1702,18 @@ njs_promise_race(njs_vm_t *vm, njs_value
{
int64_t length;
njs_int_t ret;
- njs_value_t *promise, *iterator, resolve;
+ njs_value_t *promise_ctor, *iterator, resolve;
njs_promise_iterator_args_t pargs;

- promise = njs_argument(args, 0);
+ promise_ctor = njs_argument(args, 0);
iterator = njs_arg(args, nargs, 1);

- pargs.capability = njs_promise_new_capability(vm, promise);
+ pargs.capability = njs_promise_new_capability(vm, promise_ctor);
if (njs_slow_path(pargs.capability == NULL)) {
return NJS_ERROR;
}

- ret = njs_value_property(vm, promise, njs_value_arg(&string_resolve),
+ ret = njs_value_property(vm, promise_ctor, njs_value_arg(&string_resolve),
&resolve);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
@@ -1732,7 +1732,7 @@ njs_promise_race(njs_vm_t *vm, njs_value
njs_memzero(&pargs.args, sizeof(njs_iterator_args_t));

pargs.function = njs_function(&resolve);
- pargs.constructor = promise;
+ pargs.constructor = promise_ctor;

pargs.args.value = iterator;
pargs.args.to = length;
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] Renaming promise to promise_ctor to avoid confusion.

Dmitry Volyntsev 173 June 15, 2022 08:14PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready