Welcome! Log In Create A New Profile

Advanced

[njs] Improved naming in njs_variables_scope_resolve().

Dmitry Volyntsev
December 27, 2018 03:50AM
details: https://hg.nginx.org/njs/rev/9ab8d11c151d
branches:
changeset: 700:9ab8d11c151d
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Dec 27 10:35:07 2018 +0300
description:
Improved naming in njs_variables_scope_resolve().

Thanks to ??? (Hong Zhi Dao).

diffstat:

njs/njs_variable.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r a8dff774ab62 -r 9ab8d11c151d njs/njs_variable.c
--- a/njs/njs_variable.c Thu Dec 27 10:27:46 2018 +0300
+++ b/njs/njs_variable.c Thu Dec 27 10:35:07 2018 +0300
@@ -160,7 +160,7 @@ njs_variable_reference(njs_vm_t *vm, njs

static njs_ret_t
njs_variables_scope_resolve(njs_vm_t *vm, njs_parser_scope_t *scope,
- nxt_bool_t local_scope)
+ nxt_bool_t closure)
{
njs_ret_t ret;
nxt_queue_t *nested;
@@ -178,7 +178,7 @@ njs_variables_scope_resolve(njs_vm_t *vm
{
scope = nxt_queue_link_data(lnk, njs_parser_scope_t, link);

- ret = njs_variables_scope_resolve(vm, scope, local_scope);
+ ret = njs_variables_scope_resolve(vm, scope, closure);
if (nxt_slow_path(ret != NXT_OK)) {
return NXT_ERROR;
}
@@ -192,7 +192,7 @@ njs_variables_scope_resolve(njs_vm_t *vm
break;
}

- if (!local_scope) {
+ if (closure) {
ret = njs_variable_find(vm, node->scope, &vs,
&node->u.variable_name,
node->variable_name_hash);
@@ -238,12 +238,12 @@ njs_variables_scope_reference(njs_vm_t *
* only in the local scope (reference and definition nestings are the same).
*/

- ret = njs_variables_scope_resolve(vm, scope, 0);
+ ret = njs_variables_scope_resolve(vm, scope, 1);
if (nxt_slow_path(ret != NXT_OK)) {
return NXT_ERROR;
}

- ret = njs_variables_scope_resolve(vm, scope, 1);
+ ret = njs_variables_scope_resolve(vm, scope, 0);
if (nxt_slow_path(ret != NXT_OK)) {
return NXT_ERROR;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Improved naming in njs_variables_scope_resolve().

Dmitry Volyntsev 300 December 27, 2018 03:50AM



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

Online Users

Guests: 238
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready