]> git.kaiwu.me - njs.git/commitdiff
Modules: renaming vars to rawVariables to better reflect purpose.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 26 Nov 2020 11:36:03 +0000 (11:36 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 26 Nov 2020 11:36:03 +0000 (11:36 +0000)
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.

nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c

index 437f6bef1cd81746b52d1a4671db48751657a702..a576fab5f72e06100ac912b7ab908dcd5f4889ab 100644 (file)
@@ -406,7 +406,7 @@ static njs_external_t  ngx_http_js_ext_request[] = {
 
     {
         .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,
index 2900ac578404bd2249989c6664f2b1a2f227ba5a..e53b62427436ac360e8043882eae2e744658234a 100644 (file)
@@ -245,7 +245,7 @@ static njs_external_t  ngx_stream_js_ext_session[] = {
 
     {
         .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,