]> git.kaiwu.me - njs.git/commitdiff
Removed the surplus arguments of exception macros.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 14 May 2018 11:10:23 +0000 (14:10 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 14 May 2018 11:10:23 +0000 (14:10 +0300)
19 files changed:
njs/njs_array.c
njs/njs_crypto.c
njs/njs_date.c
njs/njs_error.c
njs/njs_error.h
njs/njs_fs.c
njs/njs_function.c
njs/njs_generator.c
njs/njs_json.c
njs/njs_module.c
njs/njs_number.c
njs/njs_object.c
njs/njs_parser.c
njs/njs_parser_expression.c
njs/njs_regexp.c
njs/njs_string.c
njs/njs_time.c
njs/njs_variable.c
njs/njs_vm.c

index 37491f7da3bbf1e1754c9f733456e2deb08a68b2..2df66b06ba66b44af688f3dbb0d0ecd133a18a56 100644 (file)
@@ -230,7 +230,7 @@ njs_array_constructor(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
         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, njs_value_t *value,
         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, njs_value_t *args, nxt_uint_t nargs,
         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, njs_value_t *args, nxt_uint_t nargs)
         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_t *vm, njs_value_t *args,
         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;
         }
index ccb60710c682ced140b3d5a2bed77fc1068b4470..0946fb2200b77dff9abe34cd07b9ffe6f58c927e 100644 (file)
@@ -158,7 +158,7 @@ njs_crypto_create_hash(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args, nxt_uint_t nargs,
     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;
     }
 
index d43dc967ef491feffadc9746d33f4ee8a0228003..a4a79c7ce50b39aa34b64a528d5445bd9d503c63 100644 (file)
@@ -1043,7 +1043,7 @@ njs_date_prototype_to_iso_string(njs_vm_t *vm, njs_value_t *args,
         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_value_t *args, nxt_uint_t nargs,
         }
     }
 
-    njs_type_error(vm, "'this' argument is not an object", NULL);
+    njs_type_error(vm, "'this' argument is not an object");
 
     return NXT_ERROR;
 }
index 34fe97d8597c181a4e4ce77401bc4e592cef9a4d..19fd6c5e2f324be13787564f5ff06c5b11a9b232 100644 (file)
@@ -596,7 +596,7 @@ njs_error_prototype_to_string(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     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;
     }
 
index 719ecb6d4ed16cbe0997daf979c27d8da32b8e1c..9e8b6421959f1ac193e39e2832f965a03dddabea 100644 (file)
@@ -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, ...);
index d1a1db33a651cd142a67a8e74af2da4c05292801..0350d0f673f1ba15ec052ae5e717d11e4721d71a 100644 (file)
@@ -99,12 +99,12 @@ njs_fs_read_file(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     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_t *args, nxt_uint_t nargs,
 
         } 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_t *args, nxt_uint_t nargs,
 
     } 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_value_t *args, nxt_uint_t nargs,
     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_value_t *args, nxt_uint_t nargs,
 
         } 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_internal(njs_vm_t *vm, njs_value_t *args,
     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_internal(njs_vm_t *vm, njs_value_t *args,
 
         } 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_internal(njs_vm_t *vm, njs_value_t *args,
 
     } 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 *vm, njs_value_t *args,
     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 *vm, njs_value_t *args,
 
         } 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 *vm, const char *syscall,
 
         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 *vm, const char *syscall,
 
         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 *vm, const char *syscall,
 
         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;
         }
     }
index 67a491b5f75b7d080a8ffd756781eff67ee81965..f14788a495185e49ba87c2370e42162d083c184e 100644 (file)
@@ -240,7 +240,7 @@ njs_function_frame_alloc(njs_vm_t *vm, size_t size)
         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_value_t *args, nxt_uint_t nargs,
     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 *vm, njs_value_t *args, nxt_uint_t nargs,
     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 *vm, njs_value_t *args, nxt_uint_t nargs,
 
     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_value_t *args, nxt_uint_t nargs,
     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;
 }
index 689900c519f0c66eafb18e63e799b814789f683b..c35289fe67478d888ca336ff92865af2eb80cb86 100644 (file)
@@ -328,7 +328,7 @@ njs_generator(njs_vm_t *vm, njs_parser_t *parser, njs_parser_node_t *node)
 
     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 *vm, njs_parser_t *parser,
         }
     }
 
-    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 *vm, njs_parser_t *parser,
         }
     }
 
-    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_parser_t *parser, njs_parser_node_t *node)
                          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;
     }
 
index 173e5105bba703709261268145f7053888bf0a13..938110ba831e8032b6311af88349729ef40c9c12 100644 (file)
@@ -471,7 +471,7 @@ njs_json_parse_object(njs_json_parse_ctx_t *ctx, njs_value_t *value,
 
         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_t *ctx, njs_value_t *value,
 
         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, njs_value_t *args, nxt_uint_t nargs,
             }
 
             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, njs_value_t *args, nxt_uint_t nargs,
             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_t *vm, njs_json_parse_t *parse)
         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, njs_json_stringify_t* stringify,
         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, njs_json_stringify_t* stringify,
         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 *vm, njs_json_stringify_t *stringify,
 
     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_t *stringify, njs_value_t *value)
         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;
     }
 }
index 0c7f902525b557a2836572e800d9841968efc571..ca80cf6b5310927b578b629033ad178a10def13d 100644 (file)
@@ -43,7 +43,7 @@ njs_ret_t njs_module_require(njs_vm_t *vm, njs_value_t *args,
     nxt_lvlhsh_query_t  lhq;
 
     if (nargs < 2) {
-        njs_type_error(vm, "missing path", NULL);
+        njs_type_error(vm, "missing path");
         return NJS_ERROR;
     }
 
index 69622baf6b66ad4764913c7c35945ef21a8718ea..b9e642a6dda3327c55cb2363db4324ae044251d5 100644 (file)
@@ -611,7 +611,7 @@ njs_number_prototype_to_string(njs_vm_t *vm, njs_value_t *args,
         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;
         }
 
index 88ad39332df2ef6d8d1dc1e88e769893e0021edb..ab42e215e382c55e9d95f32f3d6c1e85c46130d2 100644 (file)
@@ -333,7 +333,7 @@ njs_property_query(njs_vm_t *vm, njs_property_query_t *pq, njs_value_t *object,
             }
         }
 
-        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, njs_value_t *args, nxt_uint_t nargs,
     }
 
     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 *vm, njs_value_t *args, nxt_uint_t nargs,
     }
 
     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 *vm, nxt_lvlhsh_t *hash,
     }
 
     /* 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 *vm, nxt_lvlhsh_t *hash,
     }
 
     /* Memory allocation or NXT_DECLINED error. */
-    njs_internal_error(vm, NULL, NULL);
+    njs_internal_error(vm, NULL);
 
     return NULL;
 }
index eba4a00260746ba43da7a277919e9182f571734a..1c9fba53809405c79c1e5191e1ee0c40f8e81e65 100644 (file)
@@ -752,8 +752,7 @@ njs_parser_return_statement(njs_vm_t *vm, njs_parser_t *parser)
          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, njs_parser_t *parser)
                     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, njs_parser_t *parser,
                                 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;
index 1b55ee727d676468f3cf1a340f48fb5b20ee6b20..fb9d5af84adfce0ce460e03309ea24035b227054 100644 (file)
@@ -277,7 +277,7 @@ njs_parser_var_expression(njs_vm_t *vm, njs_parser_t *parser, njs_token_t token)
 
         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_t *vm, njs_parser_t *parser,
 
         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 *vm, njs_parser_t *parser,
 
     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_vm_t *vm, njs_parser_t *parser,
 
     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;
     }
 
index 9295458596975c9db13879dadbdc015562a15b02..9fa044ee92437c45feefbe9709fc2d68c7218844 100644 (file)
@@ -320,7 +320,7 @@ njs_regexp_pattern_create(njs_vm_t *vm, u_char *start, size_t length,
     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_t *trace, nxt_trace_data_t *td,
     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 *vm, njs_value_t *args,
         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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args, nxt_uint_t nargs,
     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;
     }
 
index b438f586fa5261459948ba828035ce6a3714854e..b059dd7ff3554bdd0f1ca774625f2d0bcf0999b1 100644 (file)
@@ -732,7 +732,7 @@ njs_string_prototype_to_string(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs
     }
 
     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 *vm, njs_value_t *args, nxt_uint_t nargs
     (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_value_t *args, nxt_uint_t nargs,
     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, njs_value_t *args,
 
 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, njs_value_t *args, nxt_uint_t nargs,
         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_value_t *value, const uint32_t *reserve)
 
 uri_error:
 
-    njs_uri_error(vm, NULL, NULL);
+    njs_uri_error(vm, NULL);
 
     return NXT_ERROR;
 }
index 23b5e73ae98d0891bd4554a64929f104f51d8ef5..42642dfab5aacc54bfdf20f176e12d556b04ea16 100644 (file)
@@ -19,18 +19,18 @@ njs_set_timeout(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     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_t *args, nxt_uint_t nargs,
 
     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;
     }
 
index 022ab8587ff1b3c2be3896587f0b881112aafc07..8c1be25e4d60ed3b4cba307fe329b65fee414262 100644 (file)
@@ -376,7 +376,7 @@ njs_variable_get(njs_vm_t *vm, njs_parser_node_t *node)
         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;
         }
index 0119ec534aaa8c871c02d09fbc6576e894e59650..111927218d5971d24fb39856289024f95d1af2c0 100644 (file)
@@ -755,7 +755,7 @@ njs_vmcode_property_in(njs_vm_t *vm, njs_value_t *object, njs_value_t *property)
 
     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_value_t *object,
     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_value_t *value,
         }
     }
 
-    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_value_t *value, nxt_uint_t hint)
                 }
 
                 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;