From 6af4eb68f3e7c35adc10f87a499c9947e144a92f Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Wed, 6 Feb 2019 15:50:03 +0300 Subject: [PATCH] Modules: reporting njs filenames in exceptions. --- nginx/ngx_http_js_module.c | 4 ++++ nginx/ngx_stream_js_module.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index a73c2d24..c65230d6 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -2116,6 +2116,10 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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 --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index 708674b4..0fa656e3 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -1377,6 +1377,10 @@ ngx_stream_js_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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"); -- 2.47.3