[njs] Fixed http response and parent getters.

Dmitry Volyntsev xeioex at nginx.com
Thu Sep 27 14:38:12 UTC 2018


details:   http://hg.nginx.org/njs/rev/c4035cc63370
branches:  
changeset: 614:c4035cc63370
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Sep 27 17:37:55 2018 +0300
description:
Fixed http response and parent getters.

Getters are expected to set resulting value to the provided
argument, not to vm->retval.

diffstat:

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

diffs (21 lines):

diff -r 5175716b5e80 -r c4035cc63370 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Thu Sep 27 17:36:38 2018 +0300
+++ b/nginx/ngx_http_js_module.c	Thu Sep 27 17:37:55 2018 +0300
@@ -1844,7 +1844,7 @@ ngx_http_js_ext_get_response(njs_vm_t *v
 
     ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);
 
-    njs_vm_retval_set(vm, njs_value_arg(&ctx->args[1]));
+    njs_value_assign(value, njs_value_arg(&ctx->args[1]));
 
     return NJS_OK;
 }
@@ -2189,7 +2189,7 @@ ngx_http_js_ext_get_parent(njs_vm_t *vm,
         return NJS_ERROR;
     }
 
-    njs_vm_retval_set(vm, njs_value_arg(&ctx->args[0]));
+    njs_value_assign(value, njs_value_arg(&ctx->args[0]));
 
     return NJS_OK;
 }


More information about the nginx-devel mailing list