[njs] Removed the surplus arguments of exception macros.

Dmitry Volyntsev xeioex at nginx.com
Mon May 14 11:24:41 UTC 2018


details:   http://hg.nginx.org/njs/rev/464d7e2905fc
branches:  
changeset: 520:464d7e2905fc
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon May 14 14:10:23 2018 +0300
description:
Removed the surplus arguments of exception macros.

diffstat:

 njs/njs_array.c             |  10 +++++-----
 njs/njs_crypto.c            |  38 +++++++++++++++++++-------------------
 njs/njs_date.c              |   4 ++--
 njs/njs_error.c             |   2 +-
 njs/njs_error.h             |  16 ++++++++--------
 njs/njs_fs.c                |  42 +++++++++++++++++++++---------------------
 njs/njs_function.c          |  12 ++++++------
 njs/njs_generator.c         |   8 ++++----
 njs/njs_json.c              |  18 +++++++++---------
 njs/njs_module.c            |   2 +-
 njs/njs_number.c            |   2 +-
 njs/njs_object.c            |  14 +++++++-------
 njs/njs_parser.c            |   7 +++----
 njs/njs_parser_expression.c |  10 ++++------
 njs/njs_regexp.c            |  10 +++++-----
 njs/njs_string.c            |  12 ++++++------
 njs/njs_time.c              |   8 ++++----
 njs/njs_variable.c          |   2 +-
 njs/njs_vm.c                |   9 ++++-----
 19 files changed, 111 insertions(+), 115 deletions(-)

diffs (960 lines):

diff -r e33869a27515 -r 464d7e2905fc njs/njs_array.c
--- a/njs/njs_array.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_array.c	Mon May 14 14:10:23 2018 +0300
@@ -230,7 +230,7 @@ njs_array_constructor(njs_vm_t *vm, njs_
         size = (uint32_t) num;
 
         if ((double) size != num) {
-            njs_range_error(vm, NULL, NULL);
+            njs_range_error(vm, NULL);
             return NXT_ERROR;
         }
 
@@ -379,7 +379,7 @@ njs_array_prototype_length(njs_vm_t *vm,
         length = (uint32_t) num;
 
         if ((double) length != num) {
-            njs_range_error(vm, "Invalid array length", NULL);
+            njs_range_error(vm, "Invalid array length");
             return NJS_ERROR;
         }
 
@@ -1733,7 +1733,7 @@ njs_array_prototype_reduce(njs_vm_t *vm,
         n = njs_array_iterator_index(array, iter);
 
         if (n == NJS_ARRAY_INVALID_INDEX) {
-            njs_type_error(vm, "invalid index", NULL);
+            njs_type_error(vm, "invalid index");
             return NXT_ERROR;
         }
 
@@ -1794,7 +1794,7 @@ njs_array_iterator_args(njs_vm_t *vm, nj
         return NXT_OK;
     }
 
-    njs_type_error(vm, "unexpected iterator arguments", NULL);
+    njs_type_error(vm, "unexpected iterator arguments");
 
     return NXT_ERROR;
 }
@@ -1868,7 +1868,7 @@ njs_array_prototype_reduce_right(njs_vm_
         n = njs_array_reduce_right_index(array, iter);
 
         if (n == NJS_ARRAY_INVALID_INDEX) {
-            njs_type_error(vm, "invalid index", NULL);
+            njs_type_error(vm, "invalid index");
 
             return NXT_ERROR;
         }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_crypto.c
--- a/njs/njs_crypto.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_crypto.c	Mon May 14 14:10:23 2018 +0300
@@ -158,7 +158,7 @@ njs_crypto_create_hash(njs_vm_t *vm, njs
     njs_object_value_t  *hash;
 
     if (nxt_slow_path(nargs < 2 || !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "algorithm must be a string", NULL);
+        njs_type_error(vm, "algorithm must be a string");
         return NJS_ERROR;
     }
 
@@ -208,17 +208,17 @@ njs_hash_prototype_update(njs_vm_t *vm, 
     njs_object_value_t  *hash;
 
     if (nxt_slow_path(nargs < 2 || !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "data must be a string", NULL);
+        njs_type_error(vm, "data must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_object_value(&args[0]))) {
-        njs_type_error(vm, "'this' is not an object_value", NULL);
+        njs_type_error(vm, "'this' is not an object_value");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_data(&args[0].data.u.object_value->value))) {
-        njs_type_error(vm, "value of 'this' is not a data type", NULL);
+        njs_type_error(vm, "value of 'this' is not a data type");
         return NJS_ERROR;
     }
 
@@ -229,7 +229,7 @@ njs_hash_prototype_update(njs_vm_t *vm, 
     dgst = njs_value_data(&hash->value);
 
     if (nxt_slow_path(dgst->alg == NULL)) {
-        njs_error(vm, "Digest already called", NULL);
+        njs_error(vm, "Digest already called");
         return NJS_ERROR;
     }
 
@@ -254,17 +254,17 @@ njs_hash_prototype_digest(njs_vm_t *vm, 
     njs_object_value_t  *hash;
 
     if (nxt_slow_path(nargs > 1 && !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "encoding must be a string", NULL);
+        njs_type_error(vm, "encoding must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_object_value(&args[0]))) {
-        njs_type_error(vm, "'this' is not an object_value", NULL);
+        njs_type_error(vm, "'this' is not an object_value");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_data(&args[0].data.u.object_value->value))) {
-        njs_type_error(vm, "value of 'this' is not a data type", NULL);
+        njs_type_error(vm, "value of 'this' is not a data type");
         return NJS_ERROR;
     }
 
@@ -284,7 +284,7 @@ njs_hash_prototype_digest(njs_vm_t *vm, 
     dgst = njs_value_data(&hash->value);
 
     if (nxt_slow_path(dgst->alg == NULL)) {
-        njs_error(vm, "Digest already called", NULL);
+        njs_error(vm, "Digest already called");
         return NJS_ERROR;
     }
 
@@ -392,12 +392,12 @@ njs_crypto_create_hmac(njs_vm_t *vm, njs
     njs_object_value_t  *hmac;
 
     if (nxt_slow_path(nargs < 2 || !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "algorithm must be a string", NULL);
+        njs_type_error(vm, "algorithm must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(nargs < 3 || !njs_is_string(&args[2]))) {
-        njs_type_error(vm, "key must be a string", NULL);
+        njs_type_error(vm, "key must be a string");
         return NJS_ERROR;
     }
 
@@ -471,17 +471,17 @@ njs_hmac_prototype_update(njs_vm_t *vm, 
     njs_object_value_t  *hmac;
 
     if (nxt_slow_path(nargs < 2 || !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "data must be a string", NULL);
+        njs_type_error(vm, "data must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_object_value(&args[0]))) {
-        njs_type_error(vm, "'this' is not an object_value", NULL);
+        njs_type_error(vm, "'this' is not an object_value");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_data(&args[0].data.u.object_value->value))) {
-        njs_type_error(vm, "value of 'this' is not a data type", NULL);
+        njs_type_error(vm, "value of 'this' is not a data type");
         return NJS_ERROR;
     }
 
@@ -492,7 +492,7 @@ njs_hmac_prototype_update(njs_vm_t *vm, 
     ctx = njs_value_data(&hmac->value);
 
     if (nxt_slow_path(ctx->alg == NULL)) {
-        njs_error(vm, "Digest already called", NULL);
+        njs_error(vm, "Digest already called");
         return NJS_ERROR;
     }
 
@@ -517,17 +517,17 @@ njs_hmac_prototype_digest(njs_vm_t *vm, 
     njs_object_value_t  *hmac;
 
     if (nxt_slow_path(nargs > 1 && !njs_is_string(&args[1]))) {
-        njs_type_error(vm, "encoding must be a string", NULL);
+        njs_type_error(vm, "encoding must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_object_value(&args[0]))) {
-        njs_type_error(vm, "'this' is not an object_value", NULL);
+        njs_type_error(vm, "'this' is not an object_value");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_data(&args[0].data.u.object_value->value))) {
-        njs_type_error(vm, "value of 'this' is not a data type", NULL);
+        njs_type_error(vm, "value of 'this' is not a data type");
         return NJS_ERROR;
     }
 
@@ -547,7 +547,7 @@ njs_hmac_prototype_digest(njs_vm_t *vm, 
     ctx = njs_value_data(&hmac->value);
 
     if (nxt_slow_path(ctx->alg == NULL)) {
-        njs_error(vm, "Digest already called", NULL);
+        njs_error(vm, "Digest already called");
         return NJS_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_date.c
--- a/njs/njs_date.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_date.c	Mon May 14 14:10:23 2018 +0300
@@ -1043,7 +1043,7 @@ njs_date_prototype_to_iso_string(njs_vm_
         return njs_string_new(vm, &vm->retval, buf, size, size);
     }
 
-    njs_range_error(vm, NULL, NULL);
+    njs_range_error(vm, NULL);
 
     return NXT_ERROR;
 }
@@ -1891,7 +1891,7 @@ njs_date_prototype_to_json(njs_vm_t *vm,
         }
     }
 
-    njs_type_error(vm, "'this' argument is not an object", NULL);
+    njs_type_error(vm, "'this' argument is not an object");
 
     return NXT_ERROR;
 }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_error.c
--- a/njs/njs_error.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_error.c	Mon May 14 14:10:23 2018 +0300
@@ -596,7 +596,7 @@ njs_error_prototype_to_string(njs_vm_t *
     static const njs_value_t  default_name = njs_string("Error");
 
     if (nargs < 1 || !njs_is_object(&args[0])) {
-        njs_type_error(vm, "'this' argument is not an object", NULL);
+        njs_type_error(vm, "'this' argument is not an object");
         return NXT_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_error.h
--- a/njs/njs_error.h	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_error.h	Mon May 14 14:10:23 2018 +0300
@@ -9,21 +9,21 @@
 
 
 #define njs_error(vm, fmt, ...)                                               \
-    njs_exception_error_create(vm, NJS_OBJECT_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_ERROR, fmt, ##__VA_ARGS__)
 #define njs_eval_error(vm, fmt, ...)                                          \
-    njs_exception_error_create(vm, NJS_OBJECT_EVAL_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_EVAL_ERROR, fmt, ##__VA_ARGS__)
 #define njs_internal_error(vm, fmt, ...)                                      \
-    njs_exception_error_create(vm, NJS_OBJECT_INTERNAL_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_INTERNAL_ERROR, fmt, ##__VA_ARGS__)
 #define njs_range_error(vm, fmt, ...)                                         \
-    njs_exception_error_create(vm, NJS_OBJECT_RANGE_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_RANGE_ERROR, fmt, ##__VA_ARGS__)
 #define njs_reference_error(vm, fmt, ...)                                     \
-    njs_exception_error_create(vm, NJS_OBJECT_REF_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_REF_ERROR, fmt, ##__VA_ARGS__)
 #define njs_syntax_error(vm, fmt, ...)                                        \
-    njs_exception_error_create(vm, NJS_OBJECT_SYNTAX_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_SYNTAX_ERROR, fmt, ##__VA_ARGS__)
 #define njs_type_error(vm, fmt, ...)                                          \
-    njs_exception_error_create(vm, NJS_OBJECT_TYPE_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_TYPE_ERROR, fmt, ##__VA_ARGS__)
 #define njs_uri_error(vm, fmt, ...)                                           \
-    njs_exception_error_create(vm, NJS_OBJECT_URI_ERROR, fmt, __VA_ARGS__)
+    njs_exception_error_create(vm, NJS_OBJECT_URI_ERROR, fmt, ##__VA_ARGS__)
 
 void njs_exception_error_create(njs_vm_t *vm, njs_value_type_t type,
     const char* fmt, ...);
diff -r e33869a27515 -r 464d7e2905fc njs/njs_fs.c
--- a/njs/njs_fs.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_fs.c	Mon May 14 14:10:23 2018 +0300
@@ -99,12 +99,12 @@ njs_fs_read_file(njs_vm_t *vm, njs_value
     nxt_lvlhsh_query_t  lhq;
 
     if (nxt_slow_path(nargs < 3)) {
-        njs_type_error(vm, "too few arguments", NULL);
+        njs_type_error(vm, "too few arguments");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[1]))) {
-        njs_type_error(vm, "path must be a string", NULL);
+        njs_type_error(vm, "path must be a string");
         return NJS_ERROR;
     }
 
@@ -139,12 +139,12 @@ njs_fs_read_file(njs_vm_t *vm, njs_value
 
         } else {
             njs_type_error(vm, "Unknown options type "
-                           "(a string or object required)", NULL);
+                           "(a string or object required)");
             return NJS_ERROR;
         }
 
         if (nxt_slow_path(nargs < 4 || !njs_is_function(&args[3]))) {
-            njs_type_error(vm, "callback must be a function", NULL);
+            njs_type_error(vm, "callback must be a function");
             return NJS_ERROR;
         }
 
@@ -152,7 +152,7 @@ njs_fs_read_file(njs_vm_t *vm, njs_value
 
     } else {
         if (nxt_slow_path(!njs_is_function(&args[2]))) {
-            njs_type_error(vm, "callback must be a function", NULL);
+            njs_type_error(vm, "callback must be a function");
             return NJS_ERROR;
         }
 
@@ -313,12 +313,12 @@ njs_fs_read_file_sync(njs_vm_t *vm, njs_
     nxt_lvlhsh_query_t  lhq;
 
     if (nxt_slow_path(nargs < 2)) {
-        njs_type_error(vm, "too few arguments", NULL);
+        njs_type_error(vm, "too few arguments");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[1]))) {
-        njs_type_error(vm, "path must be a string", NULL);
+        njs_type_error(vm, "path must be a string");
         return NJS_ERROR;
     }
 
@@ -353,7 +353,7 @@ njs_fs_read_file_sync(njs_vm_t *vm, njs_
 
         } else {
             njs_type_error(vm, "Unknown options type "
-                           "(a string or object required)", NULL);
+                           "(a string or object required)");
             return NJS_ERROR;
         }
     }
@@ -534,17 +534,17 @@ static njs_ret_t njs_fs_write_file_inter
     nxt_lvlhsh_query_t  lhq;
 
     if (nxt_slow_path(nargs < 4)) {
-        njs_type_error(vm, "too few arguments", NULL);
+        njs_type_error(vm, "too few arguments");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[1]))) {
-        njs_type_error(vm, "path must be a string", NULL);
+        njs_type_error(vm, "path must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[2]))) {
-        njs_type_error(vm, "data must be a string", NULL);
+        njs_type_error(vm, "data must be a string");
         return NJS_ERROR;
     }
 
@@ -592,12 +592,12 @@ static njs_ret_t njs_fs_write_file_inter
 
         } else {
             njs_type_error(vm, "Unknown options type "
-                           "(a string or object required)", NULL);
+                           "(a string or object required)");
             return NJS_ERROR;
         }
 
         if (nxt_slow_path(nargs < 5 || !njs_is_function(&args[4]))) {
-            njs_type_error(vm, "callback must be a function", NULL);
+            njs_type_error(vm, "callback must be a function");
             return NJS_ERROR;
         }
 
@@ -605,7 +605,7 @@ static njs_ret_t njs_fs_write_file_inter
 
     } else {
         if (nxt_slow_path(!njs_is_function(&args[3]))) {
-            njs_type_error(vm, "callback must be a function", NULL);
+            njs_type_error(vm, "callback must be a function");
             return NJS_ERROR;
         }
 
@@ -723,17 +723,17 @@ njs_fs_write_file_sync_internal(njs_vm_t
     nxt_lvlhsh_query_t  lhq;
 
     if (nxt_slow_path(nargs < 3)) {
-        njs_type_error(vm, "too few arguments", NULL);
+        njs_type_error(vm, "too few arguments");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[1]))) {
-        njs_type_error(vm, "path must be a string", NULL);
+        njs_type_error(vm, "path must be a string");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_string(&args[2]))) {
-        njs_type_error(vm, "data must be a string", NULL);
+        njs_type_error(vm, "data must be a string");
         return NJS_ERROR;
     }
 
@@ -781,7 +781,7 @@ njs_fs_write_file_sync_internal(njs_vm_t
 
         } else {
             njs_type_error(vm, "Unknown options type "
-                           "(a string or object required)", NULL);
+                           "(a string or object required)");
             return NJS_ERROR;
         }
     }
@@ -927,7 +927,7 @@ static njs_ret_t njs_fs_error(njs_vm_t *
 
         ret = nxt_lvlhsh_insert(&error->hash, &lhq);
         if (nxt_slow_path(ret != NXT_OK)) {
-            njs_internal_error(vm, NULL, NULL);
+            njs_internal_error(vm, NULL);
             return NJS_ERROR;
         }
     }
@@ -946,7 +946,7 @@ static njs_ret_t njs_fs_error(njs_vm_t *
 
         ret = nxt_lvlhsh_insert(&error->hash, &lhq);
         if (nxt_slow_path(ret != NXT_OK)) {
-            njs_internal_error(vm, NULL, NULL);
+            njs_internal_error(vm, NULL);
             return NJS_ERROR;
         }
     }
@@ -971,7 +971,7 @@ static njs_ret_t njs_fs_error(njs_vm_t *
 
         ret = nxt_lvlhsh_insert(&error->hash, &lhq);
         if (nxt_slow_path(ret != NXT_OK)) {
-            njs_internal_error(vm, NULL, NULL);
+            njs_internal_error(vm, NULL);
             return NJS_ERROR;
         }
     }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_function.c
--- a/njs/njs_function.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_function.c	Mon May 14 14:10:23 2018 +0300
@@ -240,7 +240,7 @@ njs_function_frame_alloc(njs_vm_t *vm, s
         spare_size = nxt_align_size(spare_size, NJS_FRAME_SPARE_SIZE);
 
         if (vm->stack_size + spare_size > NJS_MAX_STACK_SIZE) {
-            njs_range_error(vm, "Maximum call stack size exceeded", NULL);
+            njs_range_error(vm, "Maximum call stack size exceeded");
             return NULL;
         }
 
@@ -501,7 +501,7 @@ njs_function_prototype_call(njs_vm_t *vm
     njs_function_t  *function;
 
     if (!njs_is_function(&args[0])) {
-        njs_type_error(vm, "'this' argument is not a function", NULL);
+        njs_type_error(vm, "'this' argument is not a function");
         return NXT_ERROR;
     }
 
@@ -529,7 +529,7 @@ njs_function_prototype_apply(njs_vm_t *v
     njs_function_t  *function;
 
     if (!njs_is_function(&args[0])) {
-        njs_type_error(vm, "'this' argument is not a function", NULL);
+        njs_type_error(vm, "'this' argument is not a function");
         return NXT_ERROR;
     }
 
@@ -538,7 +538,7 @@ njs_function_prototype_apply(njs_vm_t *v
 
     if (nargs > 2) {
         if (!njs_is_array(&args[2])) {
-            njs_type_error(vm, "second argument is not an array", NULL);
+            njs_type_error(vm, "second argument is not an array");
             return NXT_ERROR;
         }
 
@@ -610,7 +610,7 @@ njs_function_prototype_bind(njs_vm_t *vm
     njs_function_t  *function;
 
     if (!njs_is_function(&args[0])) {
-        njs_type_error(vm, "'this' argument is not a function", NULL);
+        njs_type_error(vm, "'this' argument is not a function");
         return NXT_ERROR;
     }
 
@@ -689,7 +689,7 @@ njs_ret_t
 njs_eval_function(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     njs_index_t unused)
 {
-    njs_internal_error(vm, "Not implemented", NULL);
+    njs_internal_error(vm, "Not implemented");
 
     return NXT_ERROR;
 }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_generator.c
--- a/njs/njs_generator.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_generator.c	Mon May 14 14:10:23 2018 +0300
@@ -328,7 +328,7 @@ njs_generator(njs_vm_t *vm, njs_parser_t
 
     default:
         nxt_thread_log_debug("unknown token: %d", node->token);
-        njs_syntax_error(vm, "unknown token", NULL);
+        njs_syntax_error(vm, "unknown token");
 
         return NXT_ERROR;
     }
@@ -1137,7 +1137,7 @@ njs_generate_continue_statement(njs_vm_t
         }
     }
 
-    njs_parser_syntax_error(vm, parser, "Illegal continue statement", NULL);
+    njs_parser_syntax_error(vm, parser, "Illegal continue statement");
 
     return NXT_ERROR;
 
@@ -1180,7 +1180,7 @@ njs_generate_break_statement(njs_vm_t *v
         }
     }
 
-    njs_parser_syntax_error(vm, parser, "Illegal break statement", NULL);
+    njs_parser_syntax_error(vm, parser, "Illegal break statement");
 
     return NXT_ERROR;
 
@@ -2066,7 +2066,7 @@ njs_generate_scope(njs_vm_t *vm, njs_par
                          parser->code_size, code_size);
 
     if (nxt_slow_path(parser->code_size < code_size)) {
-        njs_internal_error(vm, NULL, NULL);
+        njs_internal_error(vm, NULL);
         return NXT_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_json.c
--- a/njs/njs_json.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_json.c	Mon May 14 14:10:23 2018 +0300
@@ -471,7 +471,7 @@ njs_json_parse_object(njs_json_parse_ctx
 
         ret = nxt_lvlhsh_insert(&object->hash, &lhq);
         if (nxt_slow_path(ret != NXT_OK)) {
-            njs_internal_error(ctx->vm, NULL, NULL);
+            njs_internal_error(ctx->vm, NULL);
             return NULL;
         }
 
@@ -566,7 +566,7 @@ njs_json_parse_array(njs_json_parse_ctx_
 
         ret = njs_array_add(ctx->vm, array, element);
         if (nxt_slow_path(ret != NXT_OK)) {
-            njs_internal_error(ctx->vm, NULL, NULL);
+            njs_internal_error(ctx->vm, NULL);
             return NULL;
         }
 
@@ -981,7 +981,7 @@ njs_json_parse_continuation(njs_vm_t *vm
             }
 
             if (nxt_slow_path(ret != NXT_OK)) {
-                njs_internal_error(vm, NULL, NULL);
+                njs_internal_error(vm, NULL);
                 return NXT_ERROR;
             }
 
@@ -1019,7 +1019,7 @@ njs_json_parse_continuation(njs_vm_t *vm
             break;
 
         default:
-            njs_internal_error(vm, NULL, NULL);
+            njs_internal_error(vm, NULL);
             return NXT_ERROR;
         }
     }
@@ -1061,7 +1061,7 @@ njs_json_parse_continuation_apply(njs_vm
         break;
 
     default:
-        njs_internal_error(vm, NULL, NULL);
+        njs_internal_error(vm, NULL);
         return NXT_ERROR;
     }
 
@@ -1488,7 +1488,7 @@ njs_json_stringify_to_json(njs_vm_t *vm,
         break;
 
     default:
-        njs_internal_error(vm, NULL, NULL);
+        njs_internal_error(vm, NULL);
         return NXT_ERROR;
     }
 
@@ -1532,7 +1532,7 @@ njs_json_stringify_replacer(njs_vm_t *vm
         break;
 
     default:
-        njs_internal_error(vm, NULL, NULL);
+        njs_internal_error(vm, NULL);
         return NXT_ERROR;
     }
 
@@ -1627,7 +1627,7 @@ njs_json_push_stringify_state(njs_vm_t *
 
     if (stringify->stack.items >= 32) {
         njs_type_error(stringify->vm,
-                       "Nested too deep or a cyclic structure", NULL);
+                       "Nested too deep or a cyclic structure");
         return NULL;
     }
 
@@ -1717,7 +1717,7 @@ njs_json_append_value(njs_json_stringify
         return njs_json_buf_append(stringify, "null", 4);
 
     default:
-        njs_type_error(stringify->vm, "Non-serializable object", NULL);
+        njs_type_error(stringify->vm, "Non-serializable object");
         return NXT_DECLINED;
     }
 }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_module.c
--- a/njs/njs_module.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_module.c	Mon May 14 14:10:23 2018 +0300
@@ -43,7 +43,7 @@ njs_ret_t njs_module_require(njs_vm_t *v
     nxt_lvlhsh_query_t  lhq;
 
     if (nargs < 2) {
-        njs_type_error(vm, "missing path", NULL);
+        njs_type_error(vm, "missing path");
         return NJS_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_number.c
--- a/njs/njs_number.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_number.c	Mon May 14 14:10:23 2018 +0300
@@ -611,7 +611,7 @@ njs_number_prototype_to_string(njs_vm_t 
         radix = args[1].data.u.number;
 
         if (radix < 2 || radix > 36 || radix != (int) radix) {
-            njs_range_error(vm, NULL, NULL);
+            njs_range_error(vm, NULL);
             return NXT_ERROR;
         }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_object.c
--- a/njs/njs_object.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_object.c	Mon May 14 14:10:23 2018 +0300
@@ -333,7 +333,7 @@ njs_property_query(njs_vm_t *vm, njs_pro
             }
         }
 
-        njs_type_error(vm, "cannot get property 'unknown' of undefined", NULL);
+        njs_type_error(vm, "cannot get property 'unknown' of undefined");
 
         return NXT_ERROR;
     }
@@ -727,14 +727,14 @@ njs_object_define_property(njs_vm_t *vm,
     }
 
     if (!value->data.u.object->extensible) {
-        njs_type_error(vm, "object is not extensible", NULL);
+        njs_type_error(vm, "object is not extensible");
         return NXT_ERROR;
     }
 
     descriptor = njs_arg(args, nargs, 3);
 
     if (!njs_is_object(descriptor)){
-        njs_type_error(vm, "descriptor is not an object", NULL);
+        njs_type_error(vm, "descriptor is not an object");
         return NXT_ERROR;
     }
 
@@ -774,14 +774,14 @@ njs_object_define_properties(njs_vm_t *v
     }
 
     if (!value->data.u.object->extensible) {
-        njs_type_error(vm, "object is not extensible", NULL);
+        njs_type_error(vm, "object is not extensible");
         return NXT_ERROR;
     }
 
     descriptor = njs_arg(args, nargs, 2);
 
     if (!njs_is_object(descriptor)) {
-        njs_type_error(vm, "descriptor is not an object", NULL);
+        njs_type_error(vm, "descriptor is not an object");
         return NXT_ERROR;
     }
 
@@ -1395,7 +1395,7 @@ njs_property_prototype_create(njs_vm_t *
     }
 
     /* Memory allocation or NXT_DECLINED error. */
-    njs_internal_error(vm, NULL, NULL);
+    njs_internal_error(vm, NULL);
 
     return NULL;
 }
@@ -1638,7 +1638,7 @@ njs_property_constructor_create(njs_vm_t
     }
 
     /* Memory allocation or NXT_DECLINED error. */
-    njs_internal_error(vm, NULL, NULL);
+    njs_internal_error(vm, NULL);
 
     return NULL;
 }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_parser.c
--- a/njs/njs_parser.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_parser.c	Mon May 14 14:10:23 2018 +0300
@@ -752,8 +752,7 @@ njs_parser_return_statement(njs_vm_t *vm
          scope = scope->parent)
     {
         if (scope->type == NJS_SCOPE_GLOBAL) {
-            njs_parser_syntax_error(vm, parser, "Illegal return statement",
-                                    NULL);
+            njs_parser_syntax_error(vm, parser, "Illegal return statement");
 
             return NXT_ERROR;
         }
@@ -1037,7 +1036,7 @@ njs_parser_switch_statement(njs_vm_t *vm
                     if (dflt != NULL) {
                         njs_parser_syntax_error(vm, parser,
                                                 "More than one default clause "
-                                                "in switch statement", NULL);
+                                                "in switch statement");
 
                         return NJS_TOKEN_ILLEGAL;
                     }
@@ -2575,7 +2574,7 @@ njs_parser_unexpected_token(njs_vm_t *vm
                                 parser->lexer->text.start);
 
     } else {
-        njs_parser_syntax_error(vm, parser, "Unexpected end of input", NULL);
+        njs_parser_syntax_error(vm, parser, "Unexpected end of input");
     }
 
     return NJS_TOKEN_ILLEGAL;
diff -r e33869a27515 -r 464d7e2905fc njs/njs_parser_expression.c
--- a/njs/njs_parser_expression.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_parser_expression.c	Mon May 14 14:10:23 2018 +0300
@@ -277,7 +277,7 @@ njs_parser_var_expression(njs_vm_t *vm, 
 
         if (!njs_parser_is_lvalue(parser->node)) {
             njs_parser_ref_error(vm, parser,
-                                 "Invalid left-hand side in assignment", NULL);
+                                 "Invalid left-hand side in assignment");
             return NJS_TOKEN_ILLEGAL;
         }
 
@@ -415,7 +415,7 @@ njs_parser_assignment_expression(njs_vm_
 
         if (!njs_parser_is_lvalue(parser->node)) {
             njs_parser_ref_error(vm, parser,
-                                 "Invalid left-hand side in assignment", NULL);
+                                 "Invalid left-hand side in assignment");
             return NJS_TOKEN_ILLEGAL;
         }
 
@@ -839,8 +839,7 @@ njs_parser_inc_dec_expression(njs_vm_t *
 
     if (!njs_parser_is_lvalue(parser->node)) {
         njs_parser_ref_error(vm, parser,
-                             "Invalid left-hand side in prefix operation",
-                             NULL);
+                             "Invalid left-hand side in prefix operation");
         return NJS_TOKEN_ILLEGAL;
     }
 
@@ -894,8 +893,7 @@ njs_parser_post_inc_dec_expression(njs_v
 
     if (!njs_parser_is_lvalue(parser->node)) {
         njs_parser_ref_error(vm, parser,
-                             "Invalid left-hand side in postfix operation",
-                             NULL);
+                             "Invalid left-hand side in postfix operation");
         return NJS_TOKEN_ILLEGAL;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_regexp.c
--- a/njs/njs_regexp.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_regexp.c	Mon May 14 14:10:23 2018 +0300
@@ -320,7 +320,7 @@ njs_regexp_pattern_create(njs_vm_t *vm, 
     if (nxt_fast_path(ret >= 0)) {
 
         if (nxt_slow_path((u_int) ret != pattern->ncaptures)) {
-            njs_internal_error(vm, NULL, NULL);
+            njs_internal_error(vm, NULL);
             nxt_mem_cache_free(vm->mem_cache_pool, pattern);
             return NULL;
         }
@@ -412,7 +412,7 @@ njs_regexp_match_trace_handler(nxt_trace
     trace = trace->next;
     p = trace->handler(trace, td, start);
 
-    njs_internal_error(vm, (const char *) start, NULL);
+    njs_internal_error(vm, (const char *) start);
 
     return p;
 }
@@ -545,7 +545,7 @@ njs_regexp_prototype_to_string(njs_vm_t 
         return njs_regexp_string_create(vm, &vm->retval, source, size, length);
     }
 
-    njs_type_error(vm, "'this' argument is not a regexp", NULL);
+    njs_type_error(vm, "'this' argument is not a regexp");
 
     return NXT_ERROR;
 }
@@ -563,7 +563,7 @@ njs_regexp_prototype_test(njs_vm_t *vm, 
     njs_regexp_pattern_t  *pattern;
 
     if (!njs_is_regexp(&args[0])) {
-        njs_type_error(vm, "'this' argument is not a regexp", NULL);
+        njs_type_error(vm, "'this' argument is not a regexp");
         return NXT_ERROR;
     }
 
@@ -613,7 +613,7 @@ njs_regexp_prototype_exec(njs_vm_t *vm, 
     nxt_regex_match_data_t  *match_data;
 
     if (!njs_is_regexp(&args[0])) {
-        njs_type_error(vm, "'this' argument is not a regexp", NULL);
+        njs_type_error(vm, "'this' argument is not a regexp");
         return NXT_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_string.c
--- a/njs/njs_string.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_string.c	Mon May 14 14:10:23 2018 +0300
@@ -732,7 +732,7 @@ njs_string_prototype_to_string(njs_vm_t 
     }
 
     if (nxt_slow_path(!njs_is_string(&args[1]))) {
-        njs_type_error(vm, "encoding must be a string", NULL);
+        njs_type_error(vm, "encoding must be a string");
         return NJS_ERROR;
     }
 
@@ -741,7 +741,7 @@ njs_string_prototype_to_string(njs_vm_t 
     (void) njs_string_prop(&string, &value);
 
     if (nxt_slow_path(string.length != 0)) {
-        njs_type_error(vm, "argument must be a byte string", NULL);
+        njs_type_error(vm, "argument must be a byte string");
         return NJS_ERROR;
     }
 
@@ -781,7 +781,7 @@ njs_string_prototype_concat(njs_vm_t *vm
     njs_string_prop_t  string;
 
     if (njs_is_null_or_void(&args[0])) {
-        njs_type_error(vm, "'this' argument is null or undefined", NULL);
+        njs_type_error(vm, "'this' argument is null or undefined");
         return NXT_ERROR;
     }
 
@@ -1376,7 +1376,7 @@ njs_string_from_char_code(njs_vm_t *vm, 
 
 range_error:
 
-    njs_range_error(vm, NULL, NULL);
+    njs_range_error(vm, NULL);
 
     return NXT_ERROR;
 }
@@ -2043,7 +2043,7 @@ njs_string_prototype_repeat(njs_vm_t *vm
         n = args[1].data.u.number;
 
         if (nxt_slow_path(n < 0 || n >= max)) {
-            njs_range_error(vm, NULL, NULL);
+            njs_range_error(vm, NULL);
             return NXT_ERROR;
         }
     }
@@ -3859,7 +3859,7 @@ njs_string_decode(njs_vm_t *vm, njs_valu
 
 uri_error:
 
-    njs_uri_error(vm, NULL, NULL);
+    njs_uri_error(vm, NULL);
 
     return NXT_ERROR;
 }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_time.c
--- a/njs/njs_time.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_time.c	Mon May 14 14:10:23 2018 +0300
@@ -19,18 +19,18 @@ njs_set_timeout(njs_vm_t *vm, njs_value_
     njs_vm_ops_t  *ops;
 
     if (nxt_slow_path(nargs < 2)) {
-        njs_type_error(vm, "too few arguments", NULL);
+        njs_type_error(vm, "too few arguments");
         return NJS_ERROR;
     }
 
     if (nxt_slow_path(!njs_is_function(&args[1]))) {
-        njs_type_error(vm, "first arg must be a function", NULL);
+        njs_type_error(vm, "first arg must be a function");
         return NJS_ERROR;
     }
 
     ops = vm->ops;
     if (nxt_slow_path(ops == NULL)) {
-        njs_internal_error(vm, "not supported by host environment", NULL);
+        njs_internal_error(vm, "not supported by host environment");
         return NJS_ERROR;
     }
 
@@ -62,7 +62,7 @@ njs_set_timeout(njs_vm_t *vm, njs_value_
 
     event->host_event = ops->set_timer(vm->external, delay, event);
     if (event->host_event == NULL) {
-        njs_internal_error(vm, "set_timer() failed", NULL);
+        njs_internal_error(vm, "set_timer() failed");
         return NJS_ERROR;
     }
 
diff -r e33869a27515 -r 464d7e2905fc njs/njs_variable.c
--- a/njs/njs_variable.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_variable.c	Mon May 14 14:10:23 2018 +0300
@@ -376,7 +376,7 @@ njs_variable_get(njs_vm_t *vm, njs_parse
         index = (index >> NJS_SCOPE_SHIFT) + 1;
 
         if (index > 255 || vs.scope->argument_closures == 0) {
-            njs_internal_error(vm, "too many argument closures", NULL);
+            njs_internal_error(vm, "too many argument closures");
 
             return NULL;
         }
diff -r e33869a27515 -r 464d7e2905fc njs/njs_vm.c
--- a/njs/njs_vm.c	Mon May 07 15:49:02 2018 +0300
+++ b/njs/njs_vm.c	Mon May 14 14:10:23 2018 +0300
@@ -755,7 +755,7 @@ njs_vmcode_property_in(njs_vm_t *vm, njs
 
     case NJS_PRIMITIVE_VALUE:
     case NJS_STRING_VALUE:
-        njs_type_error(vm, "property in on a primitive value", NULL);
+        njs_type_error(vm, "property in on a primitive value");
 
         return NXT_ERROR;
 
@@ -1066,7 +1066,7 @@ njs_vmcode_instance_of(njs_vm_t *vm, njs
     static njs_value_t prototype_string = njs_string("prototype");
 
     if (!njs_is_function(constructor)) {
-        njs_type_error(vm, "right argument is not a function", NULL);
+        njs_type_error(vm, "right argument is not a function");
         return NXT_ERROR;
     }
 
@@ -1977,7 +1977,7 @@ njs_function_frame_create(njs_vm_t *vm, 
         }
     }
 
-    njs_type_error(vm, "object is not callable", NULL);
+    njs_type_error(vm, "object is not callable");
 
     return NXT_ERROR;
 }
@@ -3084,8 +3084,7 @@ njs_primitive_value(njs_vm_t *vm, njs_va
                 }
 
                 if (ret == NXT_ERROR) {
-                    njs_type_error(vm, "cannot evaluate an object's value",
-                                   NULL);
+                    njs_type_error(vm, "cannot evaluate an object's value");
                 }
 
                 return ret;


More information about the nginx-devel mailing list