Allowing to pass arbitrary number of arguments in ngx_js_call().
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 60dc8f9..9b9982d 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -660,8 +660,8 @@
 
     ctx->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
 
-    rc = ngx_js_call(ctx->vm, &jlcf->content, &ctx->request,
-                     r->connection->log);
+    rc = ngx_js_call(ctx->vm, &jlcf->content, r->connection->log,
+                     &ctx->request, 1);
 
     if (rc == NGX_ERROR) {
         ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
@@ -773,8 +773,8 @@
 
     pending = njs_vm_pending(ctx->vm);
 
-    rc = ngx_js_call(ctx->vm, &jlcf->header_filter, &ctx->request,
-                     r->connection->log);
+    rc = ngx_js_call(ctx->vm, &jlcf->header_filter, r->connection->log,
+                     &ctx->request, 1);
 
     if (rc == NGX_ERROR) {
         return NGX_ERROR;
@@ -820,7 +820,7 @@
 
     pending = njs_vm_pending(ctx->vm);
 
-    rc = ngx_js_call(ctx->vm, fname, &ctx->request, r->connection->log);
+    rc = ngx_js_call(ctx->vm, fname, r->connection->log, &ctx->request, 1);
 
     if (rc == NGX_ERROR) {
         v->not_found = 1;
diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index e2c083a..e87b825 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -66,8 +66,8 @@
 
 
 ngx_int_t
-ngx_js_call(njs_vm_t *vm, ngx_str_t *fname, njs_opaque_value_t *value,
-    ngx_log_t *log)
+ngx_js_call(njs_vm_t *vm, ngx_str_t *fname, ngx_log_t *log,
+    njs_opaque_value_t *args, njs_uint_t nargs)
 {
     njs_str_t        name, exception;
     njs_function_t  *func;
@@ -82,7 +82,7 @@
         return NGX_ERROR;
     }
 
-    if (njs_vm_call(vm, func, njs_value_arg(value), 1) != NJS_OK) {
+    if (njs_vm_call(vm, func, njs_value_arg(args), nargs) != NJS_OK) {
         njs_vm_retval_string(vm, &exception);
 
         ngx_log_error(NGX_LOG_ERR, log, 0,
diff --git a/nginx/ngx_js.h b/nginx/ngx_js.h
index b2165e2..bc80515 100644
--- a/nginx/ngx_js.h
+++ b/nginx/ngx_js.h
@@ -49,8 +49,8 @@
                              : njs_vm_value_buffer_set(vm, value, start, len))
 
 
-ngx_int_t ngx_js_call(njs_vm_t *vm, ngx_str_t *s, njs_opaque_value_t *value,
-    ngx_log_t *log);
+ngx_int_t ngx_js_call(njs_vm_t *vm, ngx_str_t *fname, ngx_log_t *log,
+    njs_opaque_value_t *args, njs_uint_t nargs);
 
 njs_int_t ngx_js_ext_log(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
     njs_index_t level);
diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c
index 0b24ea7..013377c 100644
--- a/nginx/ngx_stream_js_module.c
+++ b/nginx/ngx_stream_js_module.c
@@ -461,7 +461,8 @@
 
         ctx->status = NGX_ERROR;
 
-        rc = ngx_js_call(ctx->vm, name, &ctx->args[0], c->log);
+        rc = ngx_js_call(ctx->vm, name, c->log, &ctx->args[0], 1);
+
         if (rc == NGX_ERROR) {
             return rc;
         }
@@ -534,7 +535,8 @@
     ctx = ngx_stream_get_module_ctx(s, ngx_stream_js_module);
 
     if (!ctx->filter) {
-        rc = ngx_js_call(ctx->vm, &jscf->filter, &ctx->args[0], c->log);
+        rc = ngx_js_call(ctx->vm, &jscf->filter, c->log, &ctx->args[0], 1);
+
         if (rc == NGX_ERROR) {
             return rc;
         }
@@ -630,7 +632,7 @@
 
     pending = njs_vm_pending(ctx->vm);
 
-    rc = ngx_js_call(ctx->vm, fname, &ctx->args[0], s->connection->log);
+    rc = ngx_js_call(ctx->vm, fname, s->connection->log, &ctx->args[0], 1);
 
     if (rc == NGX_ERROR) {
         v->not_found = 1;