[njs] Eliminating redundant NJS_METHOD type.

Dmitry Volyntsev xeioex at nginx.com
Tue Aug 6 16:46:09 UTC 2019


details:   https://hg.nginx.org/njs/rev/30b1199acaaf
branches:  
changeset: 1111:30b1199acaaf
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Aug 06 19:45:23 2019 +0300
description:
Eliminating redundant NJS_METHOD type.

Previously, NJS_METHOD was the same as NJS_PROPERTY with function value
type.

diffstat:

 src/njs_array.c       |  52 ++++++++++++++--------------
 src/njs_boolean.c     |   4 +-
 src/njs_builtin.c     |   4 +-
 src/njs_crypto.c      |  16 ++++----
 src/njs_date.c        |  92 +++++++++++++++++++++++++-------------------------
 src/njs_error.c       |   6 +-
 src/njs_fs.c          |  12 +++---
 src/njs_function.c    |   6 +-
 src/njs_json.c        |   4 +-
 src/njs_math.c        |  70 +++++++++++++++++++-------------------
 src/njs_number.c      |  16 ++++----
 src/njs_object.c      |  42 +++++++++++-----------
 src/njs_object_prop.c |   5 --
 src/njs_regexp.c      |   6 +-
 src/njs_string.c      |  66 ++++++++++++++++++------------------
 src/njs_value.c       |   6 +--
 src/njs_value.h       |   1 -
 src/njs_vmcode.c      |   1 -
 18 files changed, 200 insertions(+), 209 deletions(-)

diffs (truncated from 1906 to 1000 lines):

diff -r df385232d2af -r 30b1199acaaf src/njs_array.c
--- a/src/njs_array.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_array.c	Tue Aug 06 19:45:23 2019 +0300
@@ -280,7 +280,7 @@ static const njs_object_prop_t  njs_arra
 
     /* Array.isArray(). */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("isArray"),
         .value = njs_native_function(njs_array_is_array, 0),
         .writable = 1,
@@ -290,7 +290,7 @@ static const njs_object_prop_t  njs_arra
     /* ES6. */
     /* Array.of(). */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("of"),
         .value = njs_native_function(njs_array_of, 0),
         .writable = 1,
@@ -1975,7 +1975,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("slice"),
         .value = njs_native_function(njs_array_prototype_slice,
                      NJS_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
@@ -1984,7 +1984,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("push"),
         .value = njs_native_function(njs_array_prototype_push, 0),
         .writable = 1,
@@ -1992,7 +1992,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("pop"),
         .value = njs_native_function(njs_array_prototype_pop, 0),
         .writable = 1,
@@ -2000,7 +2000,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("unshift"),
         .value = njs_native_function(njs_array_prototype_unshift, 0),
         .writable = 1,
@@ -2008,7 +2008,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("shift"),
         .value = njs_native_function(njs_array_prototype_shift, 0),
         .writable = 1,
@@ -2016,7 +2016,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("splice"),
         .value = njs_native_function(njs_array_prototype_splice,
                     NJS_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
@@ -2025,7 +2025,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("reverse"),
         .value = njs_native_function(njs_array_prototype_reverse,
                                      NJS_OBJECT_ARG),
@@ -2034,7 +2034,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_array_prototype_to_string, 0),
         .writable = 1,
@@ -2042,7 +2042,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("join"),
         .value = njs_native_function(njs_array_prototype_join,
                      NJS_OBJECT_ARG, NJS_STRING_ARG),
@@ -2051,7 +2051,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("concat"),
         .value = njs_native_function(njs_array_prototype_concat, 0),
         .writable = 1,
@@ -2059,7 +2059,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("indexOf"),
         .value = njs_native_function(njs_array_prototype_index_of,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
@@ -2068,7 +2068,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("lastIndexOf"),
         .value = njs_native_function(njs_array_prototype_last_index_of,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
@@ -2078,7 +2078,7 @@ static const njs_object_prop_t  njs_arra
 
     /* ES7. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("includes"),
         .value = njs_native_function(njs_array_prototype_includes,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
@@ -2087,7 +2087,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("forEach"),
         .value = njs_native_function(njs_array_prototype_for_each, 0),
         .writable = 1,
@@ -2095,7 +2095,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("some"),
         .value = njs_native_function(njs_array_prototype_some, 0),
         .writable = 1,
@@ -2103,7 +2103,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("every"),
         .value = njs_native_function(njs_array_prototype_every, 0),
         .writable = 1,
@@ -2112,7 +2112,7 @@ static const njs_object_prop_t  njs_arra
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("fill"),
         .value = njs_native_function(njs_array_prototype_fill,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_NUMBER_ARG,
@@ -2122,7 +2122,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("filter"),
         .value = njs_native_function(njs_array_prototype_filter, 0),
         .writable = 1,
@@ -2131,7 +2131,7 @@ static const njs_object_prop_t  njs_arra
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("find"),
         .value = njs_native_function(njs_array_prototype_find, 0),
         .writable = 1,
@@ -2140,7 +2140,7 @@ static const njs_object_prop_t  njs_arra
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("findIndex"),
         .value = njs_native_function(njs_array_prototype_find_index, 0),
         .writable = 1,
@@ -2148,7 +2148,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("map"),
         .value = njs_native_function(njs_array_prototype_map, 0),
         .writable = 1,
@@ -2156,7 +2156,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("reduce"),
         .value = njs_native_function(njs_array_prototype_reduce, 0),
         .writable = 1,
@@ -2164,7 +2164,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("reduceRight"),
         .value = njs_native_function(njs_array_prototype_reduce_right, 0),
         .writable = 1,
@@ -2172,7 +2172,7 @@ static const njs_object_prop_t  njs_arra
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("sort"),
         .value = njs_native_function(njs_array_prototype_sort, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_boolean.c
--- a/src/njs_boolean.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_boolean.c	Tue Aug 06 19:45:23 2019 +0300
@@ -143,7 +143,7 @@ static const njs_object_prop_t  njs_bool
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_boolean_prototype_value_of, 0),
         .writable = 1,
@@ -151,7 +151,7 @@ static const njs_object_prop_t  njs_bool
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_boolean_prototype_to_string, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_builtin.c
--- a/src/njs_builtin.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_builtin.c	Tue Aug 06 19:45:23 2019 +0300
@@ -964,7 +964,7 @@ njs_builtin_match(const njs_object_init_
         for (i = 0; i < o->items; i++) {
             pr = &o->properties[i];
 
-            if (pr->type != NJS_METHOD) {
+            if (pr->type != NJS_PROPERTY || !njs_is_function(&pr->value)) {
                 continue;
             }
 
@@ -1116,7 +1116,7 @@ static const njs_object_prop_t  njs_njs_
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("dump"),
         .value = njs_native_function(njs_dump_value,
                                     NJS_SKIP_ARG, NJS_SKIP_ARG, NJS_NUMBER_ARG),
diff -r df385232d2af -r 30b1199acaaf src/njs_crypto.c
--- a/src/njs_crypto.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_crypto.c	Tue Aug 06 19:45:23 2019 +0300
@@ -321,7 +321,7 @@ static const njs_object_prop_t  njs_hash
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_hash_prototype_to_string, 0),
         .writable = 1,
@@ -329,7 +329,7 @@ static const njs_object_prop_t  njs_hash
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("update"),
         .value = njs_native_function(njs_hash_prototype_update,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
@@ -338,7 +338,7 @@ static const njs_object_prop_t  njs_hash
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("digest"),
         .value = njs_native_function(njs_hash_prototype_digest,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
@@ -583,7 +583,7 @@ static const njs_object_prop_t  njs_hmac
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_hmac_prototype_to_string, 0),
         .writable = 1,
@@ -591,7 +591,7 @@ static const njs_object_prop_t  njs_hmac
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("update"),
         .value = njs_native_function(njs_hmac_prototype_update,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
@@ -600,7 +600,7 @@ static const njs_object_prop_t  njs_hmac
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("digest"),
         .value = njs_native_function(njs_hmac_prototype_digest,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
@@ -648,7 +648,7 @@ static const njs_object_prop_t  njs_cryp
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("createHash"),
         .value = njs_native_function(njs_crypto_create_hash,
                                      NJS_SKIP_ARG),
@@ -657,7 +657,7 @@ static const njs_object_prop_t  njs_cryp
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("createHmac"),
         .value = njs_native_function(njs_crypto_create_hmac,
                                      NJS_SKIP_ARG),
diff -r df385232d2af -r 30b1199acaaf src/njs_date.c
--- a/src/njs_date.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_date.c	Tue Aug 06 19:45:23 2019 +0300
@@ -912,7 +912,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("UTC"),
         .value = njs_native_function(njs_date_utc, 0),
         .writable = 1,
@@ -920,7 +920,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("now"),
         .value = njs_native_function(njs_date_now, 0),
         .writable = 1,
@@ -928,7 +928,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("parse"),
         .value = njs_native_function(njs_date_parse,
                                      NJS_SKIP_ARG, NJS_STRING_ARG),
@@ -1936,7 +1936,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_date_prototype_value_of, NJS_DATE_ARG),
         .writable = 1,
@@ -1944,7 +1944,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_date_prototype_to_string,
                                      NJS_DATE_ARG),
@@ -1953,7 +1953,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toDateString"),
         .value = njs_native_function(njs_date_prototype_to_date_string,
                                      NJS_DATE_ARG),
@@ -1962,7 +1962,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toTimeString"),
         .value = njs_native_function(njs_date_prototype_to_time_string,
                                      NJS_DATE_ARG),
@@ -1971,7 +1971,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toLocaleString"),
         .value = njs_native_function(njs_date_prototype_to_string,
                                      NJS_DATE_ARG),
@@ -1980,7 +1980,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("toLocaleDateString"),
         .value = njs_native_function(njs_date_prototype_to_date_string,
                                      NJS_DATE_ARG),
@@ -1989,7 +1989,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("toLocaleTimeString"),
         .value = njs_native_function(njs_date_prototype_to_time_string,
                                      NJS_DATE_ARG),
@@ -1998,7 +1998,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toUTCString"),
         .value = njs_native_function(njs_date_prototype_to_utc_string,
                                      NJS_DATE_ARG),
@@ -2007,7 +2007,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toISOString"),
         .value = njs_native_function(njs_date_prototype_to_iso_string,
                                      NJS_DATE_ARG),
@@ -2016,7 +2016,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getTime"),
         .value = njs_native_function(njs_date_prototype_value_of, NJS_DATE_ARG),
         .writable = 1,
@@ -2024,7 +2024,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getFullYear"),
         .value = njs_native_function(njs_date_prototype_get_full_year,
                                      NJS_DATE_ARG),
@@ -2033,7 +2033,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCFullYear"),
         .value = njs_native_function(njs_date_prototype_get_utc_full_year,
                                      NJS_DATE_ARG),
@@ -2042,7 +2042,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getMonth"),
         .value = njs_native_function(njs_date_prototype_get_month,
                                      NJS_DATE_ARG),
@@ -2051,7 +2051,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCMonth"),
         .value = njs_native_function(njs_date_prototype_get_utc_month,
                                      NJS_DATE_ARG),
@@ -2060,7 +2060,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getDate"),
         .value = njs_native_function(njs_date_prototype_get_date,
                                      NJS_DATE_ARG),
@@ -2069,7 +2069,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCDate"),
         .value = njs_native_function(njs_date_prototype_get_utc_date,
                                      NJS_DATE_ARG),
@@ -2078,7 +2078,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getDay"),
         .value = njs_native_function(njs_date_prototype_get_day, NJS_DATE_ARG),
         .writable = 1,
@@ -2086,7 +2086,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCDay"),
         .value = njs_native_function(njs_date_prototype_get_utc_day,
                                      NJS_DATE_ARG),
@@ -2095,7 +2095,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getHours"),
         .value = njs_native_function(njs_date_prototype_get_hours,
                                      NJS_DATE_ARG),
@@ -2104,7 +2104,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCHours"),
         .value = njs_native_function(njs_date_prototype_get_utc_hours,
                                      NJS_DATE_ARG),
@@ -2113,7 +2113,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getMinutes"),
         .value = njs_native_function(njs_date_prototype_get_minutes,
                                      NJS_DATE_ARG),
@@ -2122,7 +2122,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCMinutes"),
         .value = njs_native_function(njs_date_prototype_get_utc_minutes,
                                      NJS_DATE_ARG),
@@ -2131,7 +2131,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getSeconds"),
         .value = njs_native_function(njs_date_prototype_get_seconds,
                                      NJS_DATE_ARG),
@@ -2140,7 +2140,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("getUTCSeconds"),
         .value = njs_native_function(njs_date_prototype_get_seconds,
                                      NJS_DATE_ARG),
@@ -2149,7 +2149,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("getMilliseconds"),
         .value = njs_native_function(njs_date_prototype_get_milliseconds,
                                      NJS_DATE_ARG),
@@ -2158,7 +2158,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("getUTCMilliseconds"),
         .value = njs_native_function(njs_date_prototype_get_milliseconds,
                                      NJS_DATE_ARG),
@@ -2167,7 +2167,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("getTimezoneOffset"),
         .value = njs_native_function(njs_date_prototype_get_timezone_offset,
                                      NJS_DATE_ARG),
@@ -2176,7 +2176,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setTime"),
         .value = njs_native_function(njs_date_prototype_set_time,
                                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2185,7 +2185,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("setMilliseconds"),
         .value = njs_native_function(njs_date_prototype_set_milliseconds,
                                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2194,7 +2194,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_long_string("setUTCMilliseconds"),
         .value = njs_native_function(njs_date_prototype_set_milliseconds,
                                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2203,7 +2203,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds,
                                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2212,7 +2212,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
@@ -2221,7 +2221,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setMinutes"),
         .value = njs_native_function(njs_date_prototype_set_minutes,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2231,7 +2231,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCMinutes"),
         .value = njs_native_function(njs_date_prototype_set_utc_minutes,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2241,7 +2241,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setHours"),
         .value = njs_native_function(njs_date_prototype_set_hours,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2251,7 +2251,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCHours"),
         .value = njs_native_function(njs_date_prototype_set_utc_hours,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2261,7 +2261,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setDate"),
         .value = njs_native_function(njs_date_prototype_set_date,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2270,7 +2270,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCDate"),
         .value = njs_native_function(njs_date_prototype_set_utc_date,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
@@ -2279,7 +2279,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setMonth"),
         .value = njs_native_function(njs_date_prototype_set_month,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
@@ -2288,7 +2288,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCMonth"),
         .value = njs_native_function(njs_date_prototype_set_utc_month,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
@@ -2297,7 +2297,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setFullYear"),
         .value = njs_native_function(njs_date_prototype_set_full_year,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2307,7 +2307,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("setUTCFullYear"),
         .value = njs_native_function(njs_date_prototype_set_utc_full_year,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
@@ -2317,7 +2317,7 @@ static const njs_object_prop_t  njs_date
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toJSON"),
         .value = njs_native_function(njs_date_prototype_to_json, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_error.c
--- a/src/njs_error.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_error.c	Tue Aug 06 19:45:23 2019 +0300
@@ -711,7 +711,7 @@ static const njs_object_prop_t  njs_erro
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_error_prototype_value_of, 0),
         .writable = 1,
@@ -719,7 +719,7 @@ static const njs_object_prop_t  njs_erro
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_error_prototype_to_string, 0),
         .writable = 1,
@@ -793,7 +793,7 @@ static const njs_object_prop_t  njs_inte
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_internal_error_prototype_to_string, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_fs.c
--- a/src/njs_fs.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_fs.c	Tue Aug 06 19:45:23 2019 +0300
@@ -1017,7 +1017,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("readFile"),
         .value = njs_native_function(njs_fs_read_file, 0),
         .writable = 1,
@@ -1025,7 +1025,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("readFileSync"),
         .value = njs_native_function(njs_fs_read_file_sync, 0),
         .writable = 1,
@@ -1033,7 +1033,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("appendFile"),
         .value = njs_native_function(njs_fs_append_file, 0),
         .writable = 1,
@@ -1041,7 +1041,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("appendFileSync"),
         .value = njs_native_function(njs_fs_append_file_sync, 0),
         .writable = 1,
@@ -1049,7 +1049,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("writeFile"),
         .value = njs_native_function(njs_fs_write_file, 0),
         .writable = 1,
@@ -1057,7 +1057,7 @@ static const njs_object_prop_t  njs_fs_o
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("writeFileSync"),
         .value = njs_native_function(njs_fs_write_file_sync, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_function.c
--- a/src/njs_function.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_function.c	Tue Aug 06 19:45:23 2019 +0300
@@ -1152,7 +1152,7 @@ static const njs_object_prop_t  njs_func
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("call"),
         .value = njs_native_function(njs_function_prototype_call, 0),
         .writable = 1,
@@ -1160,7 +1160,7 @@ static const njs_object_prop_t  njs_func
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("apply"),
         .value = njs_native_function(njs_function_prototype_apply, 0),
         .writable = 1,
@@ -1168,7 +1168,7 @@ static const njs_object_prop_t  njs_func
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("bind"),
         .value = njs_native_function(njs_function_prototype_bind, 0),
         .writable = 1,
diff -r df385232d2af -r 30b1199acaaf src/njs_json.c
--- a/src/njs_json.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_json.c	Tue Aug 06 19:45:23 2019 +0300
@@ -2082,7 +2082,7 @@ static const njs_object_prop_t  njs_json
 {
     /* JSON.parse(). */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("parse"),
         .value = njs_native_function(njs_json_parse,
                                      NJS_SKIP_ARG, NJS_STRING_ARG,
@@ -2093,7 +2093,7 @@ static const njs_object_prop_t  njs_json
 
     /* JSON.stringify(). */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("stringify"),
         .value = njs_native_function(njs_json_stringify,
                                      NJS_SKIP_ARG, NJS_SKIP_ARG, NJS_SKIP_ARG,
diff -r df385232d2af -r 30b1199acaaf src/njs_math.c
--- a/src/njs_math.c	Tue Aug 06 18:46:50 2019 +0300
+++ b/src/njs_math.c	Tue Aug 06 19:45:23 2019 +0300
@@ -831,7 +831,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("abs"),
         .value = njs_native_function(njs_object_math_abs,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -840,7 +840,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("acos"),
         .value = njs_native_function(njs_object_math_acos,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -850,7 +850,7 @@ static const njs_object_prop_t  njs_math
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("acosh"),
         .value = njs_native_function(njs_object_math_acosh,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -859,7 +859,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("asin"),
         .value = njs_native_function(njs_object_math_asin,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -869,7 +869,7 @@ static const njs_object_prop_t  njs_math
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("asinh"),
         .value = njs_native_function(njs_object_math_asinh,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -878,7 +878,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("atan"),
         .value = njs_native_function(njs_object_math_atan,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -887,7 +887,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("atan2"),
         .value = njs_native_function(njs_object_math_atan2,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
@@ -897,7 +897,7 @@ static const njs_object_prop_t  njs_math
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("atanh"),
         .value = njs_native_function(njs_object_math_atanh,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -907,7 +907,7 @@ static const njs_object_prop_t  njs_math
 
     /* ES6. */
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("cbrt"),
         .value = njs_native_function(njs_object_math_cbrt,
                                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
@@ -916,7 +916,7 @@ static const njs_object_prop_t  njs_math
     },
 
     {
-        .type = NJS_METHOD,
+        .type = NJS_PROPERTY,
         .name = njs_string("ceil"),


More information about the nginx-devel mailing list