]> git.kaiwu.me - njs.git/commitdiff
Modules: reporting njs filenames in exceptions.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 6 Feb 2019 12:50:03 +0000 (15:50 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 6 Feb 2019 12:50:03 +0000 (15:50 +0300)
nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c

index a73c2d240d0c45a919db5ff625b7cf1daac6b7ed..c65230d6500caa8071729f648a1d40713b1ad690 100644 (file)
@@ -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");
index 708674b475cef458458b37530848bce7e24aebe0..0fa656e306e4309ef9d7898f12a138e286a2dfd7 100644 (file)
@@ -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");