Welcome! Log In Create A New Profile

Advanced

[njs] Modules: renaming vars to rawVariables to better reflect purpose.

Dmitry Volyntsev
November 26, 2020 06:40AM
details: https://hg.nginx.org/njs/rev/a141a29417dc
branches:
changeset: 1574:a141a29417dc
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Nov 26 11:36:03 2020 +0000
description:
Modules: renaming vars to rawVariables to better reflect purpose.

In 434f20c29f4c, obj.vars was introduced. obj.vars is almost identical
to obj.variables except a value of the Buffer type is returned.

Since most nginx variables are valid strings, it is preferable to
leave both variants.

To avoid confusion rawVariables name is used for Buffer variables.

diffstat:

nginx/ngx_http_js_module.c | 2 +-
nginx/ngx_stream_js_module.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 42dfbf020c68 -r a141a29417dc nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Thu Nov 26 11:11:01 2020 +0000
+++ b/nginx/ngx_http_js_module.c Thu Nov 26 11:36:03 2020 +0000
@@ -406,7 +406,7 @@ static njs_external_t ngx_http_js_ext_r

{
.flags = NJS_EXTERN_OBJECT,
- .name.string = njs_str("vars"),
+ .name.string = njs_str("rawVariables"),
.u.object = {
.writable = 1,
.prop_handler = ngx_http_js_ext_variables,
diff -r 42dfbf020c68 -r a141a29417dc nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c Thu Nov 26 11:11:01 2020 +0000
+++ b/nginx/ngx_stream_js_module.c Thu Nov 26 11:36:03 2020 +0000
@@ -245,7 +245,7 @@ static njs_external_t ngx_stream_js_ext

{
.flags = NJS_EXTERN_OBJECT,
- .name.string = njs_str("vars"),
+ .name.string = njs_str("rawVariables"),
.u.object = {
.writable = 1,
.prop_handler = ngx_stream_js_ext_variables,
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Modules: renaming vars to rawVariables to better reflect purpose.

Dmitry Volyntsev 419 November 26, 2020 06:40AM



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

Online Users

Guests: 279
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