From: Dmitry Volyntsev Date: Wed, 6 Feb 2019 12:50:03 +0000 (+0300) Subject: Modules: reporting njs filenames in exceptions. X-Git-Tag: 0.2.8~38 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=6af4eb68f3e7c35adc10f87a499c9947e144a92f;p=njs.git Modules: reporting njs filenames in exceptions. --- 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");