[njs] Modules: reporting njs filenames in exceptions.

Dmitry Volyntsev xeioex at nginx.com
Wed Feb 6 14:34:38 UTC 2019


details:   https://hg.nginx.org/njs/rev/342aa58f4e65
branches:  
changeset: 764:342aa58f4e65
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Feb 06 15:50:03 2019 +0300
description:
Modules: reporting njs filenames in exceptions.

diffstat:

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

diffs (28 lines):

diff -r 2c7a52ca206e -r 342aa58f4e65 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Wed Feb 06 12:27:41 2019 +0800
+++ b/nginx/ngx_http_js_module.c	Wed Feb 06 15:50:03 2019 +0300
@@ -2116,6 +2116,10 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_
     options.backtrace = 1;
     options.ops = &ngx_http_js_ops;
 
+    file = value[1];
+    options.file.start = file.data;
+    options.file.length = file.len;
+
     jmcf->vm = njs_vm_create(&options);
     if (jmcf->vm == NULL) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "failed to create JS VM");
diff -r 2c7a52ca206e -r 342aa58f4e65 nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Wed Feb 06 12:27:41 2019 +0800
+++ b/nginx/ngx_stream_js_module.c	Wed Feb 06 15:50:03 2019 +0300
@@ -1377,6 +1377,10 @@ ngx_stream_js_include(ngx_conf_t *cf, ng
     options.backtrace = 1;
     options.ops = &ngx_stream_js_ops;
 
+    file = value[1];
+    options.file.start = file.data;
+    options.file.length = file.len;
+
     jmcf->vm = njs_vm_create(&options);
     if (jmcf->vm == NULL) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "failed to create JS VM");


More information about the nginx-devel mailing list