[njs] Made writable most of built-in properties and methods.

Valentin Bartenev vbart at nginx.com
Thu May 23 12:54:47 UTC 2019


details:   https://hg.nginx.org/njs/rev/f7eedb8257eb
branches:  
changeset: 980:f7eedb8257eb
user:      Valentin Bartenev <vbart at nginx.com>
date:      Thu May 23 15:05:51 2019 +0300
description:
Made writable most of built-in properties and methods.

diffstat:

 njs/njs_array.c          |  29 ++++++++++++++++++++++++++++-
 njs/njs_boolean.c        |   4 ++++
 njs/njs_crypto.c         |   8 ++++++++
 njs/njs_date.c           |  48 ++++++++++++++++++++++++++++++++++++++++++++++++
 njs/njs_error.c          |  19 +++++++++++++++++++
 njs/njs_fs.c             |   6 ++++++
 njs/njs_function.c       |   4 ++++
 njs/njs_json.c           |   2 ++
 njs/njs_math.c           |  36 ++++++++++++++++++++++++++++++++++++
 njs/njs_number.c         |  10 ++++++++++
 njs/njs_object.c         |  22 ++++++++++++++++++++++
 njs/njs_regexp.c         |   4 ++++
 njs/njs_string.c         |  32 ++++++++++++++++++++++++++++++++
 njs/test/njs_unit_test.c |  46 ++++++++++++++++++++++++++++++++--------------
 14 files changed, 255 insertions(+), 15 deletions(-)

diffs (truncated from 1970 to 1000 lines):

diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_array.c
--- a/njs/njs_array.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_array.c	Thu May 23 15:05:51 2019 +0300
@@ -397,6 +397,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("isArray"),
         .value = njs_native_function(njs_array_is_array, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -406,6 +407,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("of"),
         .value = njs_native_function(njs_array_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -2252,13 +2254,14 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("length"),
         .value = njs_prop_handler(njs_array_length),
-        .writable = 1
+        .writable = 1,
     },
 
     {
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2268,6 +2271,7 @@ static const njs_object_prop_t  njs_arra
         .value = njs_native_function(njs_array_prototype_slice,
                      njs_continuation_size(njs_array_slice_t),
                      NJS_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2275,6 +2279,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("push"),
         .value = njs_native_function(njs_array_prototype_push, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2282,6 +2287,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("pop"),
         .value = njs_native_function(njs_array_prototype_pop, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2289,6 +2295,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("unshift"),
         .value = njs_native_function(njs_array_prototype_unshift, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2296,6 +2303,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("shift"),
         .value = njs_native_function(njs_array_prototype_shift, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2304,6 +2312,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("splice"),
         .value = njs_native_function(njs_array_prototype_splice, 0,
                     NJS_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2312,6 +2321,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("reverse"),
         .value = njs_native_function(njs_array_prototype_reverse, 0,
                     NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2320,6 +2330,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("toString"),
         .value = njs_native_function(njs_array_prototype_to_string,
                      NJS_CONTINUATION_SIZE, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2329,6 +2340,7 @@ static const njs_object_prop_t  njs_arra
         .value = njs_native_function(njs_array_prototype_join,
                      njs_continuation_size(njs_array_join_t),
                      NJS_OBJECT_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2336,6 +2348,7 @@ static const njs_object_prop_t  njs_arra
         .type = NJS_METHOD,
         .name = njs_string("concat"),
         .value = njs_native_function(njs_array_prototype_concat, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2344,6 +2357,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("indexOf"),
         .value = njs_native_function(njs_array_prototype_index_of, 0,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2352,6 +2366,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("lastIndexOf"),
         .value = njs_native_function(njs_array_prototype_last_index_of, 0,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2361,6 +2376,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("includes"),
         .value = njs_native_function(njs_array_prototype_includes, 0,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2369,6 +2385,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("forEach"),
         .value = njs_native_function(njs_array_prototype_for_each,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2377,6 +2394,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("some"),
         .value = njs_native_function(njs_array_prototype_some,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2385,6 +2403,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("every"),
         .value = njs_native_function(njs_array_prototype_every,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2395,6 +2414,7 @@ static const njs_object_prop_t  njs_arra
         .value = njs_native_function(njs_array_prototype_fill, 0,
                      NJS_OBJECT_ARG, NJS_SKIP_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2403,6 +2423,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("filter"),
         .value = njs_native_function(njs_array_prototype_filter,
                      njs_continuation_size(njs_array_filter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2412,6 +2433,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("find"),
         .value = njs_native_function(njs_array_prototype_find,
                      njs_continuation_size(njs_array_find_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2421,6 +2443,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("findIndex"),
         .value = njs_native_function(njs_array_prototype_find_index,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2429,6 +2452,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("map"),
         .value = njs_native_function(njs_array_prototype_map,
                      njs_continuation_size(njs_array_map_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2437,6 +2461,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("reduce"),
         .value = njs_native_function(njs_array_prototype_reduce,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2445,6 +2470,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("reduceRight"),
         .value = njs_native_function(njs_array_prototype_reduce_right,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2453,6 +2479,7 @@ static const njs_object_prop_t  njs_arra
         .name = njs_string("sort"),
         .value = njs_native_function(njs_array_prototype_sort,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_boolean.c
--- a/njs/njs_boolean.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_boolean.c	Thu May 23 15:05:51 2019 +0300
@@ -131,6 +131,7 @@ static const njs_object_prop_t  njs_bool
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("__proto__"),
         .value = njs_prop_handler(njs_primitive_prototype_get_proto),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -138,6 +139,7 @@ static const njs_object_prop_t  njs_bool
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -145,6 +147,7 @@ static const njs_object_prop_t  njs_bool
         .type = NJS_METHOD,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_boolean_prototype_value_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -152,6 +155,7 @@ static const njs_object_prop_t  njs_bool
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_boolean_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_crypto.c
--- a/njs/njs_crypto.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_crypto.c	Thu May 23 15:05:51 2019 +0300
@@ -338,6 +338,7 @@ static const njs_object_prop_t  njs_hash
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_hash_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -346,6 +347,7 @@ static const njs_object_prop_t  njs_hash
         .name = njs_string("update"),
         .value = njs_native_function(njs_hash_prototype_update, 0,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -354,6 +356,7 @@ static const njs_object_prop_t  njs_hash
         .name = njs_string("digest"),
         .value = njs_native_function(njs_hash_prototype_digest, 0,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -606,6 +609,7 @@ static const njs_object_prop_t  njs_hmac
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_hmac_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -614,6 +618,7 @@ static const njs_object_prop_t  njs_hmac
         .name = njs_string("update"),
         .value = njs_native_function(njs_hmac_prototype_update, 0,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -622,6 +627,7 @@ static const njs_object_prop_t  njs_hmac
         .name = njs_string("digest"),
         .value = njs_native_function(njs_hmac_prototype_digest, 0,
                                      NJS_OBJECT_ARG, NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -669,6 +675,7 @@ static const njs_object_prop_t  njs_cryp
         .name = njs_string("createHash"),
         .value = njs_native_function(njs_crypto_create_hash, 0,
                                      NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -677,6 +684,7 @@ static const njs_object_prop_t  njs_cryp
         .name = njs_string("createHmac"),
         .value = njs_native_function(njs_crypto_create_hmac, 0,
                                      NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_date.c
--- a/njs/njs_date.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_date.c	Thu May 23 15:05:51 2019 +0300
@@ -918,6 +918,7 @@ static const njs_object_prop_t  njs_date
         .type = NJS_METHOD,
         .name = njs_string("UTC"),
         .value = njs_native_function(njs_date_utc, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -925,6 +926,7 @@ static const njs_object_prop_t  njs_date
         .type = NJS_METHOD,
         .name = njs_string("now"),
         .value = njs_native_function(njs_date_now, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -933,6 +935,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("parse"),
         .value = njs_native_function(njs_date_parse, 0,
                      NJS_SKIP_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -1944,6 +1947,7 @@ static const njs_object_prop_t  njs_date
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("__proto__"),
         .value = njs_prop_handler(njs_primitive_prototype_get_proto),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1951,6 +1955,7 @@ static const njs_object_prop_t  njs_date
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1959,6 +1964,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_date_prototype_value_of, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1967,6 +1973,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toString"),
         .value = njs_native_function(njs_date_prototype_to_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1975,6 +1982,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toDateString"),
         .value = njs_native_function(njs_date_prototype_to_date_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1983,6 +1991,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toTimeString"),
         .value = njs_native_function(njs_date_prototype_to_time_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1991,6 +2000,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toLocaleString"),
         .value = njs_native_function(njs_date_prototype_to_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1999,6 +2009,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("toLocaleDateString"),
         .value = njs_native_function(njs_date_prototype_to_date_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2007,6 +2018,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("toLocaleTimeString"),
         .value = njs_native_function(njs_date_prototype_to_time_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2015,6 +2027,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toUTCString"),
         .value = njs_native_function(njs_date_prototype_to_utc_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2023,6 +2036,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toISOString"),
         .value = njs_native_function(njs_date_prototype_to_iso_string, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2031,6 +2045,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getTime"),
         .value = njs_native_function(njs_date_prototype_value_of, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2039,6 +2054,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getFullYear"),
         .value = njs_native_function(njs_date_prototype_get_full_year, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2047,6 +2063,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCFullYear"),
         .value = njs_native_function(njs_date_prototype_get_utc_full_year, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2055,6 +2072,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getMonth"),
         .value = njs_native_function(njs_date_prototype_get_month, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2063,6 +2081,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCMonth"),
         .value = njs_native_function(njs_date_prototype_get_utc_month, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2071,6 +2090,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getDate"),
         .value = njs_native_function(njs_date_prototype_get_date, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2079,6 +2099,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCDate"),
         .value = njs_native_function(njs_date_prototype_get_utc_date, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2087,6 +2108,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getDay"),
         .value = njs_native_function(njs_date_prototype_get_day, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2095,6 +2117,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCDay"),
         .value = njs_native_function(njs_date_prototype_get_utc_day, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2103,6 +2126,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getHours"),
         .value = njs_native_function(njs_date_prototype_get_hours, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2111,6 +2135,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCHours"),
         .value = njs_native_function(njs_date_prototype_get_utc_hours, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2119,6 +2144,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getMinutes"),
         .value = njs_native_function(njs_date_prototype_get_minutes, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2127,6 +2153,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCMinutes"),
         .value = njs_native_function(njs_date_prototype_get_utc_minutes, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2135,6 +2162,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getSeconds"),
         .value = njs_native_function(njs_date_prototype_get_seconds, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2143,6 +2171,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("getUTCSeconds"),
         .value = njs_native_function(njs_date_prototype_get_seconds, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2151,6 +2180,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("getMilliseconds"),
         .value = njs_native_function(njs_date_prototype_get_milliseconds, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2159,6 +2189,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("getUTCMilliseconds"),
         .value = njs_native_function(njs_date_prototype_get_milliseconds, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2167,6 +2198,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("getTimezoneOffset"),
         .value = njs_native_function(njs_date_prototype_get_timezone_offset, 0,
                      NJS_DATE_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2175,6 +2207,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setTime"),
         .value = njs_native_function(njs_date_prototype_set_time, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2183,6 +2216,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("setMilliseconds"),
         .value = njs_native_function(njs_date_prototype_set_milliseconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2191,6 +2225,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_long_string("setUTCMilliseconds"),
         .value = njs_native_function(njs_date_prototype_set_milliseconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2199,6 +2234,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2207,6 +2243,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setUTCSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2216,6 +2253,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_minutes, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2225,6 +2263,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_utc_minutes, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2234,6 +2273,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_hours, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2243,6 +2283,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_utc_hours, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2251,6 +2292,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setDate"),
         .value = njs_native_function(njs_date_prototype_set_date, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2259,6 +2301,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setUTCDate"),
         .value = njs_native_function(njs_date_prototype_set_utc_date, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2267,6 +2310,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setMonth"),
         .value = njs_native_function(njs_date_prototype_set_month, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2275,6 +2319,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("setUTCMonth"),
         .value = njs_native_function(njs_date_prototype_set_utc_month, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2284,6 +2329,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_full_year, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2293,6 +2339,7 @@ static const njs_object_prop_t  njs_date
         .value = njs_native_function(njs_date_prototype_set_utc_full_year, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2301,6 +2348,7 @@ static const njs_object_prop_t  njs_date
         .name = njs_string("toJSON"),
         .value = njs_native_function(njs_date_prototype_to_json,
                      NJS_CONTINUATION_SIZE, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_error.c
--- a/njs/njs_error.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_error.c	Thu May 23 15:05:51 2019 +0300
@@ -695,6 +695,7 @@ static const njs_object_prop_t  njs_erro
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("Error"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -702,6 +703,7 @@ static const njs_object_prop_t  njs_erro
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -709,6 +711,7 @@ static const njs_object_prop_t  njs_erro
         .type = NJS_PROPERTY,
         .name = njs_string("message"),
         .value = njs_string(""),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -716,6 +719,7 @@ static const njs_object_prop_t  njs_erro
         .type = NJS_METHOD,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_error_prototype_value_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -723,6 +727,7 @@ static const njs_object_prop_t  njs_erro
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_error_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -741,6 +746,7 @@ static const njs_object_prop_t  njs_eval
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("EvalError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -748,6 +754,7 @@ static const njs_object_prop_t  njs_eval
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -786,6 +793,7 @@ static const njs_object_prop_t  njs_inte
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("InternalError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -794,6 +802,7 @@ static const njs_object_prop_t  njs_inte
         .name = njs_string("toString"),
         .value = njs_native_function(njs_internal_error_prototype_to_string,
                                      0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -812,6 +821,7 @@ static const njs_object_prop_t  njs_rang
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("RangeError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -819,6 +829,7 @@ static const njs_object_prop_t  njs_rang
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -837,6 +848,7 @@ static const njs_object_prop_t  njs_refe
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("ReferenceError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -844,6 +856,7 @@ static const njs_object_prop_t  njs_refe
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -862,6 +875,7 @@ static const njs_object_prop_t  njs_synt
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("SyntaxError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -869,6 +883,7 @@ static const njs_object_prop_t  njs_synt
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -887,6 +902,7 @@ static const njs_object_prop_t  njs_type
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("TypeError"),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -894,6 +910,7 @@ static const njs_object_prop_t  njs_type
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -912,6 +929,7 @@ static const njs_object_prop_t  njs_uri_
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -919,6 +937,7 @@ static const njs_object_prop_t  njs_uri_
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("URIError"),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_fs.c
--- a/njs/njs_fs.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_fs.c	Thu May 23 15:05:51 2019 +0300
@@ -1042,6 +1042,7 @@ static const njs_object_prop_t  njs_fs_o
         .name = njs_string("readFile"),
         .value = njs_native_function(njs_fs_read_file,
                                      njs_continuation_size(njs_fs_cont_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1049,6 +1050,7 @@ static const njs_object_prop_t  njs_fs_o
         .type = NJS_METHOD,
         .name = njs_string("readFileSync"),
         .value = njs_native_function(njs_fs_read_file_sync, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1057,6 +1059,7 @@ static const njs_object_prop_t  njs_fs_o
         .name = njs_string("appendFile"),
         .value = njs_native_function(njs_fs_append_file,
                                      njs_continuation_size(njs_fs_cont_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1065,6 +1068,7 @@ static const njs_object_prop_t  njs_fs_o
         .name = njs_string("appendFileSync"),
         .value = njs_native_function(njs_fs_append_file_sync,
                                      njs_continuation_size(njs_fs_cont_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1073,6 +1077,7 @@ static const njs_object_prop_t  njs_fs_o
         .name = njs_string("writeFile"),
         .value = njs_native_function(njs_fs_write_file,
                                      njs_continuation_size(njs_fs_cont_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1081,6 +1086,7 @@ static const njs_object_prop_t  njs_fs_o
         .name = njs_string("writeFileSync"),
         .value = njs_native_function(njs_fs_write_file_sync,
                                      njs_continuation_size(njs_fs_cont_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_function.c
--- a/njs/njs_function.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_function.c	Thu May 23 15:05:51 2019 +0300
@@ -1193,6 +1193,7 @@ static const njs_object_prop_t  njs_func
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1200,6 +1201,7 @@ static const njs_object_prop_t  njs_func
         .type = NJS_METHOD,
         .name = njs_string("call"),
         .value = njs_native_function(njs_function_prototype_call, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1207,6 +1209,7 @@ static const njs_object_prop_t  njs_func
         .type = NJS_METHOD,
         .name = njs_string("apply"),
         .value = njs_native_function(njs_function_prototype_apply, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1214,6 +1217,7 @@ static const njs_object_prop_t  njs_func
         .type = NJS_METHOD,
         .name = njs_string("bind"),
         .value = njs_native_function(njs_function_prototype_bind, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_json.c
--- a/njs/njs_json.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_json.c	Thu May 23 15:05:51 2019 +0300
@@ -2077,6 +2077,7 @@ static const njs_object_prop_t  njs_json
                                     njs_continuation_size(njs_json_parse_t),
                                     NJS_SKIP_ARG, NJS_STRING_ARG,
                                     NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2088,6 +2089,7 @@ static const njs_object_prop_t  njs_json
                                     njs_continuation_size(njs_json_stringify_t),
                                     NJS_SKIP_ARG, NJS_SKIP_ARG, NJS_SKIP_ARG,
                                     NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
diff -r ff591ba3e780 -r f7eedb8257eb njs/njs_math.c
--- a/njs/njs_math.c	Thu May 23 15:05:50 2019 +0300
+++ b/njs/njs_math.c	Thu May 23 15:05:51 2019 +0300
@@ -820,6 +820,7 @@ static const njs_object_prop_t  njs_math
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("__proto__"),
         .value = njs_prop_handler(njs_object_prototype_proto),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -828,6 +829,7 @@ static const njs_object_prop_t  njs_math
         .name = njs_string("abs"),
         .value = njs_native_function(njs_object_math_abs, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -836,6 +838,7 @@ static const njs_object_prop_t  njs_math
         .name = njs_string("acos"),
         .value = njs_native_function(njs_object_math_acos, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,


More information about the nginx-devel mailing list