]> git.kaiwu.me - njs.git/commitdiff
Made writable most of built-in properties and methods.
authorValentin Bartenev <vbart@nginx.com>
Thu, 23 May 2019 12:05:51 +0000 (15:05 +0300)
committerValentin Bartenev <vbart@nginx.com>
Thu, 23 May 2019 12:05:51 +0000 (15:05 +0300)
14 files changed:
njs/njs_array.c
njs/njs_boolean.c
njs/njs_crypto.c
njs/njs_date.c
njs/njs_error.c
njs/njs_fs.c
njs/njs_function.c
njs/njs_json.c
njs/njs_math.c
njs/njs_number.c
njs/njs_object.c
njs/njs_regexp.c
njs/njs_string.c
njs/test/njs_unit_test.c

index 0659a46c6d67d81b97adb292f72fc1ff5240cd1e..efd055868216f71a39c2140f01e55f76300697d7 100644 (file)
@@ -397,6 +397,7 @@ static const njs_object_prop_t  njs_array_constructor_properties[] =
         .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_array_constructor_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .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_array_prototype_properties[] =
         .name = njs_string("sort"),
         .value = njs_native_function(njs_array_prototype_sort,
                      njs_continuation_size(njs_array_iter_t), 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
index 79a677785e7a2a9dad2e3624e38d2c31f2ec3047..4fbc47fcb89c34d88afc0086cefdf313cb931c34 100644 (file)
@@ -131,6 +131,7 @@ static const njs_object_prop_t  njs_boolean_prototype_properties[] =
         .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_boolean_prototype_properties[] =
         .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_boolean_prototype_properties[] =
         .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_boolean_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_boolean_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
index ba452e4a2761afa8c8e9a520ac2c66280c09204d..99737105e58350b22d8bc317d5f933710dd945d9 100644 (file)
@@ -338,6 +338,7 @@ static const njs_object_prop_t  njs_hash_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_crypto_object_properties[] =
         .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_crypto_object_properties[] =
         .name = njs_string("createHmac"),
         .value = njs_native_function(njs_crypto_create_hmac, 0,
                                      NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
index 99ecf37304ba5c345b980ba969a7578a9475485a..e1ca585c4ca1ab85059e94fca2f44d66365ef4f7 100644 (file)
@@ -918,6 +918,7 @@ static const njs_object_prop_t  njs_date_constructor_properties[] =
         .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_constructor_properties[] =
         .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_constructor_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .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_prototype_properties[] =
         .name = njs_string("toJSON"),
         .value = njs_native_function(njs_date_prototype_to_json,
                      NJS_CONTINUATION_SIZE, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
index a3deac74ef9525e90f6d3403cb34efb097c39336..82967adb74843581b14b9ebf6d8b405f100d958a 100644 (file)
@@ -695,6 +695,7 @@ static const njs_object_prop_t  njs_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_internal_error_prototype_properties[] =
         .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_internal_error_prototype_properties[] =
         .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_range_error_prototype_properties[] =
         .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_range_error_prototype_properties[] =
         .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_reference_error_prototype_properties[] =
         .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_reference_error_prototype_properties[] =
         .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_syntax_error_prototype_properties[] =
         .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_syntax_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .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_error_prototype_properties[] =
         .type = NJS_PROPERTY,
         .name = njs_string("name"),
         .value = njs_string("URIError"),
+        .writable = 1,
         .configurable = 1,
     },
 };
index 5e9d5cf507fe1a082932607e64c12c7a83ebb83c..3f897e2d528008ab7125ef6353fc76aac9db4fec 100644 (file)
@@ -1042,6 +1042,7 @@ static const njs_object_prop_t  njs_fs_object_properties[] =
         .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_object_properties[] =
         .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_object_properties[] =
         .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_object_properties[] =
         .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_object_properties[] =
         .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_object_properties[] =
         .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,
     },
 
index ddf570f3e956a40a786046132034789b560d790b..f649c2a4de84f9911a20571bde94f0d6428f401a 100644 (file)
@@ -1193,6 +1193,7 @@ static const njs_object_prop_t  njs_function_prototype_properties[] =
         .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_function_prototype_properties[] =
         .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_function_prototype_properties[] =
         .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_function_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("bind"),
         .value = njs_native_function(njs_function_prototype_bind, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
index a2c33ece555b5e63d38ef457e52c54ae8d43c298..aceffbd735519111faaba4c561a33b5303c28548 100644 (file)
@@ -2077,6 +2077,7 @@ static const njs_object_prop_t  njs_json_object_properties[] =
                                     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_object_properties[] =
                                     njs_continuation_size(njs_json_stringify_t),
                                     NJS_SKIP_ARG, NJS_SKIP_ARG, NJS_SKIP_ARG,
                                     NJS_SKIP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index c004f81217f04a4ca447e94c6f0e1d62ac50dc6d..9b4ef2e56624d013c4b11dc59741578801068df6 100644 (file)
@@ -820,6 +820,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .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_object_properties[] =
         .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_object_properties[] =
         .name = njs_string("acos"),
         .value = njs_native_function(njs_object_math_acos, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -845,6 +848,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("acosh"),
         .value = njs_native_function(njs_object_math_acosh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -853,6 +857,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("asin"),
         .value = njs_native_function(njs_object_math_asin, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -862,6 +867,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("asinh"),
         .value = njs_native_function(njs_object_math_asinh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -870,6 +876,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("atan"),
         .value = njs_native_function(njs_object_math_atan, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -878,6 +885,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("atan2"),
         .value = njs_native_function(njs_object_math_atan2, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -887,6 +895,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("atanh"),
         .value = njs_native_function(njs_object_math_atanh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -896,6 +905,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("cbrt"),
         .value = njs_native_function(njs_object_math_cbrt, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -904,6 +914,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("ceil"),
         .value = njs_native_function(njs_object_math_ceil, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -913,6 +924,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("clz32"),
         .value = njs_native_function(njs_object_math_clz32, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -921,6 +933,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("cos"),
         .value = njs_native_function(njs_object_math_cos, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -930,6 +943,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("cosh"),
         .value = njs_native_function(njs_object_math_cosh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -938,6 +952,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("exp"),
         .value = njs_native_function(njs_object_math_exp, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -947,6 +962,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("expm1"),
         .value = njs_native_function(njs_object_math_expm1, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -955,6 +971,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("floor"),
         .value = njs_native_function(njs_object_math_floor, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -964,6 +981,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("fround"),
         .value = njs_native_function(njs_object_math_fround, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -972,6 +990,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("hypot"),
         .value = njs_native_function(njs_object_math_hypot, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -981,6 +1000,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("imul"),
         .value = njs_native_function(njs_object_math_imul, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -989,6 +1009,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("log"),
         .value = njs_native_function(njs_object_math_log, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -998,6 +1019,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("log10"),
         .value = njs_native_function(njs_object_math_log10, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1007,6 +1029,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("log1p"),
         .value = njs_native_function(njs_object_math_log1p, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1016,6 +1039,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("log2"),
         .value = njs_native_function(njs_object_math_log2, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1023,6 +1047,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("max"),
         .value = njs_native_function(njs_object_math_max, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1030,6 +1055,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("min"),
         .value = njs_native_function(njs_object_math_min, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1038,6 +1064,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("pow"),
         .value = njs_native_function(njs_object_math_pow, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1045,6 +1072,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("random"),
         .value = njs_native_function(njs_object_math_random, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1053,6 +1081,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("round"),
         .value = njs_native_function(njs_object_math_round, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1062,6 +1091,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("sign"),
         .value = njs_native_function(njs_object_math_sign, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1070,6 +1100,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("sin"),
         .value = njs_native_function(njs_object_math_sin, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1079,6 +1110,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("sinh"),
         .value = njs_native_function(njs_object_math_sinh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1087,6 +1119,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("sqrt"),
         .value = njs_native_function(njs_object_math_sqrt, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1095,6 +1128,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("tan"),
         .value = njs_native_function(njs_object_math_tan, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1104,6 +1138,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("tanh"),
         .value = njs_native_function(njs_object_math_tanh, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1113,6 +1148,7 @@ static const njs_object_prop_t  njs_math_object_properties[] =
         .name = njs_string("trunc"),
         .value = njs_native_function(njs_object_math_trunc, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index 7d63589bd0fa6d9324c6574e7d562ba97e9d01ea..8e16f7da720382b9dd4953fdebc0518db1eaf25a 100644 (file)
@@ -458,6 +458,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("isFinite"),
         .value = njs_native_function(njs_number_is_finite, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -466,6 +467,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("isInteger"),
         .value = njs_native_function(njs_number_is_integer, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -474,6 +476,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("isSafeInteger"),
         .value = njs_native_function(njs_number_is_safe_integer, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -482,6 +485,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("isNaN"),
         .value = njs_native_function(njs_number_is_nan, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -491,6 +495,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .name = njs_string("parseFloat"),
         .value = njs_native_function(njs_number_parse_float, 0,
                      NJS_SKIP_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -500,6 +505,7 @@ static const njs_object_prop_t  njs_number_constructor_properties[] =
         .name = njs_string("parseInt"),
         .value = njs_native_function(njs_number_parse_int, 0,
                      NJS_SKIP_ARG, NJS_STRING_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -650,6 +656,7 @@ static const njs_object_prop_t  njs_number_prototype_properties[] =
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("__proto__"),
         .value = njs_prop_handler(njs_primitive_prototype_get_proto),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -657,6 +664,7 @@ static const njs_object_prop_t  njs_number_prototype_properties[] =
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -664,6 +672,7 @@ static const njs_object_prop_t  njs_number_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_number_prototype_value_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -672,6 +681,7 @@ static const njs_object_prop_t  njs_number_prototype_properties[] =
         .name = njs_string("toString"),
         .value = njs_native_function(njs_number_prototype_to_string, 0,
                      NJS_SKIP_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index d8fbdf858681fe2ba9b9f626931c33296972664e..46b15cd49cfef6b6916a2945480ce5ca1fe6e64f 100644 (file)
@@ -2623,6 +2623,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("create"),
         .value = njs_native_function(njs_object_create, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2632,6 +2633,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("keys"),
         .value = njs_native_function(njs_object_keys, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2641,6 +2643,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("values"),
         .value = njs_native_function(njs_object_values, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2650,6 +2653,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("entries"),
         .value = njs_native_function(njs_object_entries, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2660,6 +2664,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .value = njs_native_function(njs_object_define_property, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG,
                                      NJS_STRING_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2670,6 +2675,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .value = njs_native_function(njs_object_define_properties, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG,
                                      NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2680,6 +2686,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .value = njs_native_function(njs_object_get_own_property_descriptor, 0,
                                      NJS_SKIP_ARG, NJS_SKIP_ARG,
                                      NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2689,6 +2696,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_long_string("getOwnPropertyDescriptors"),
         .value = njs_native_function(njs_object_get_own_property_descriptors, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2698,6 +2706,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_long_string("getOwnPropertyNames"),
         .value = njs_native_function(njs_object_get_own_property_names, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2707,6 +2716,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("getPrototypeOf"),
         .value = njs_native_function(njs_object_get_prototype_of, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2716,6 +2726,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("freeze"),
         .value = njs_native_function(njs_object_freeze, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2725,6 +2736,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("isFrozen"),
         .value = njs_native_function(njs_object_is_frozen, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2734,6 +2746,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("seal"),
         .value = njs_native_function(njs_object_seal, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2743,6 +2756,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("isSealed"),
         .value = njs_native_function(njs_object_is_sealed, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2752,6 +2766,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_long_string("preventExtensions"),
         .value = njs_native_function(njs_object_prevent_extensions, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -2761,6 +2776,7 @@ static const njs_object_prop_t  njs_object_constructor_properties[] =
         .name = njs_string("isExtensible"),
         .value = njs_native_function(njs_object_is_extensible, 0,
                                      NJS_SKIP_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -3169,6 +3185,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3176,6 +3193,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_object_prototype_value_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3183,6 +3201,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_object_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3191,6 +3210,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .name = njs_string("hasOwnProperty"),
         .value = njs_native_function(njs_object_prototype_has_own_property, 0,
                                      NJS_OBJECT_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3199,6 +3219,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .name = njs_long_string("propertyIsEnumerable"),
         .value = njs_native_function(njs_object_prototype_prop_is_enumerable, 0,
                                      NJS_OBJECT_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3207,6 +3228,7 @@ static const njs_object_prop_t  njs_object_prototype_properties[] =
         .name = njs_string("isPrototypeOf"),
         .value = njs_native_function(njs_object_prototype_is_prototype_of, 0,
                                      NJS_OBJECT_ARG, NJS_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index 72854efb6f52ed2bdf994b84880c102a367ba5c5..ffd885185c3e7fa765a27545e5d4005bf8dbc5d7 100644 (file)
@@ -1125,6 +1125,7 @@ static const njs_object_prop_t  njs_regexp_prototype_properties[] =
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1166,6 +1167,7 @@ static const njs_object_prop_t  njs_regexp_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_regexp_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1174,6 +1176,7 @@ static const njs_object_prop_t  njs_regexp_prototype_properties[] =
         .name = njs_string("test"),
         .value = njs_native_function(njs_regexp_prototype_test, 0,
                      NJS_OBJECT_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -1182,6 +1185,7 @@ static const njs_object_prop_t  njs_regexp_prototype_properties[] =
         .name = njs_string("exec"),
         .value = njs_native_function(njs_regexp_prototype_exec, 0,
                      NJS_OBJECT_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index d62607949fb01bacc7b76d48ac8a9519b39809d5..a109887fe7c2bcea4685b52ec668d098af9c518d 100644 (file)
@@ -603,6 +603,7 @@ static const njs_object_prop_t  njs_string_constructor_properties[] =
         .name = njs_string("bytesFrom"),
         .value = njs_native_function(njs_string_bytes_from, 0, NJS_SKIP_ARG,
                                      NJS_SKIP_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -611,6 +612,7 @@ static const njs_object_prop_t  njs_string_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("fromCharCode"),
         .value = njs_native_function(njs_string_from_char_code, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -619,6 +621,7 @@ static const njs_object_prop_t  njs_string_constructor_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("fromCodePoint"),
         .value = njs_native_function(njs_string_from_char_code, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 };
@@ -3927,6 +3930,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .type = NJS_PROPERTY_HANDLER,
         .name = njs_string("constructor"),
         .value = njs_prop_handler(njs_object_prototype_create_constructor),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3934,6 +3938,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("valueOf"),
         .value = njs_native_function(njs_string_prototype_value_of, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3941,6 +3946,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("toString"),
         .value = njs_native_function(njs_string_prototype_to_string, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3948,6 +3954,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .type = NJS_METHOD,
         .name = njs_string("concat"),
         .value = njs_native_function(njs_string_prototype_concat, 0, 0),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3956,6 +3963,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("fromUTF8"),
         .value = njs_native_function(njs_string_prototype_from_utf8, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3964,6 +3972,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("toUTF8"),
         .value = njs_native_function(njs_string_prototype_to_utf8, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3972,6 +3981,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("fromBytes"),
         .value = njs_native_function(njs_string_prototype_from_bytes, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3980,6 +3990,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("toBytes"),
         .value = njs_native_function(njs_string_prototype_to_bytes, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3988,6 +3999,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("slice"),
         .value = njs_native_function(njs_string_prototype_slice, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -3996,6 +4008,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("substring"),
         .value = njs_native_function(njs_string_prototype_substring, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4004,6 +4017,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("substr"),
         .value = njs_native_function(njs_string_prototype_substr, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4012,6 +4026,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("charAt"),
         .value = njs_native_function(njs_string_prototype_char_at, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4020,6 +4035,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("charCodeAt"),
         .value = njs_native_function(njs_string_prototype_char_code_at, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4029,6 +4045,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("codePointAt"),
         .value = njs_native_function(njs_string_prototype_char_code_at, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4037,6 +4054,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("indexOf"),
         .value = njs_native_function(njs_string_prototype_index_of, 0,
                      NJS_STRING_OBJECT_ARG, NJS_STRING_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4045,6 +4063,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("lastIndexOf"),
         .value = njs_native_function(njs_string_prototype_last_index_of, 0,
                      NJS_STRING_OBJECT_ARG, NJS_STRING_ARG, NJS_NUMBER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4054,6 +4073,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("includes"),
         .value = njs_native_function(njs_string_prototype_includes, 0,
                      NJS_STRING_OBJECT_ARG, NJS_STRING_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4063,6 +4083,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("startsWith"),
         .value = njs_native_function(njs_string_prototype_starts_with, 0,
                      NJS_STRING_OBJECT_ARG, NJS_STRING_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4072,6 +4093,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("endsWith"),
         .value = njs_native_function(njs_string_prototype_ends_with, 0,
                      NJS_STRING_OBJECT_ARG, NJS_STRING_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4080,6 +4102,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("toLowerCase"),
         .value = njs_native_function(njs_string_prototype_to_lower_case, 0,
                      NJS_STRING_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4088,6 +4111,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("toUpperCase"),
         .value = njs_native_function(njs_string_prototype_to_upper_case, 0,
                      NJS_STRING_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4096,6 +4120,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("trim"),
         .value = njs_native_function(njs_string_prototype_trim, 0,
                      NJS_STRING_OBJECT_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4105,6 +4130,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("repeat"),
         .value = njs_native_function(njs_string_prototype_repeat, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4114,6 +4140,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("padStart"),
         .value = njs_native_function(njs_string_prototype_pad_start, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4123,6 +4150,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("padEnd"),
         .value = njs_native_function(njs_string_prototype_pad_end, 0,
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG, NJS_STRING_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4131,6 +4159,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("search"),
         .value = njs_native_function(njs_string_prototype_search, 0,
                      NJS_STRING_OBJECT_ARG, NJS_REGEXP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4139,6 +4168,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("match"),
         .value = njs_native_function(njs_string_prototype_match, 0,
                      NJS_STRING_OBJECT_ARG, NJS_REGEXP_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4147,6 +4177,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .name = njs_string("split"),
         .value = njs_native_function(njs_string_prototype_split, 0,
                      NJS_STRING_OBJECT_ARG, NJS_REGEXP_ARG, NJS_INTEGER_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 
@@ -4156,6 +4187,7 @@ static const njs_object_prop_t  njs_string_prototype_properties[] =
         .value = njs_native_function(njs_string_prototype_replace,
                      njs_continuation_size(njs_string_replace_t),
                      NJS_STRING_OBJECT_ARG, NJS_REGEXP_ARG, NJS_FUNCTION_ARG),
+        .writable = 1,
         .configurable = 1,
     },
 };
index fa5f85205696cf9b7d715ceae94b6584d137e944..a3dc530cd1ac2af1db9b7bd39c70a80d09ca7561 100644 (file)
@@ -3485,7 +3485,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("var a = []; a.concat([])"),
       nxt_string("") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var s = { toString: function() { return 'S' } };"
                  "var v = { toString: 8, valueOf: function() { return 'V' } };"
                  "var o = [9]; o.join = function() { return 'O' };"
@@ -3503,7 +3502,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("var a = [1,2,3]; a.join = 'NO';"
                  "Object.prototype.toString = function () { return 'A' }; a"),
       nxt_string("[object Array]") },
-#endif
 
     { nxt_string("Array.prototype.toString.call(1)"),
       nxt_string("[object Number]") },
@@ -6166,11 +6164,9 @@ static njs_unit_test_t  njs_test[] =
                     "(function(){(function(){(function(){})})})})})})})"),
       nxt_string("SyntaxError: The maximum function nesting level is \"5\" in 1") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("Function.prototype.toString = function () {return 'X'};"
                  "eval"),
       nxt_string("X") },
-#endif
 
     { nxt_string("var o = {f:function(x){ return x**2}}; o.f\n(2)"),
       nxt_string("4") },
@@ -7429,7 +7425,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Error('e')"),
       nxt_string("Error: e") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var e = Error('e'); e.name = 'E'; e"),
       nxt_string("E: e") },
 
@@ -7441,7 +7436,6 @@ static njs_unit_test_t  njs_test[] =
 
     { nxt_string("var e = Error(); e.name = ''; e.message = 'e'; e"),
       nxt_string("e") },
-#endif
 
     { nxt_string("Error('e').name + ': ' + Error('e').message"),
       nxt_string("Error: e") },
@@ -7515,7 +7509,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("URIError('e').name + ': ' + URIError('e').message"),
       nxt_string("URIError: e") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var e = EvalError('e'); e.name = 'E'; e"),
       nxt_string("E: e") },
 
@@ -7541,7 +7534,6 @@ static njs_unit_test_t  njs_test[] =
 
     { nxt_string("var e = MemoryError('e'); e.name = 'E'"),
       nxt_string("TypeError: Cannot add property \"name\", object is not extensible") },
-#endif
 
     { nxt_string("EvalError.prototype.name"),
       nxt_string("EvalError") },
@@ -8292,6 +8284,9 @@ static njs_unit_test_t  njs_test[] =
                  "var a = []; for(var p in x) a.push(p); a"),
       nxt_string("a,b,0,1,2") },
 
+    { nxt_string("var o = Object.create(Math); o.abs = -5; Math.abs(o.abs)"),
+      nxt_string("5") },
+
     { nxt_string("Object.prototype.toString.call(Object.prototype)"),
       nxt_string("[object Object]") },
 
@@ -8418,10 +8413,8 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Array.constructor === Function"),
       nxt_string("true") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var a = []; a.join = 'OK'; a"),
       nxt_string("[object Array]") },
-#endif
 
     { nxt_string("[].__proto__ === Array.prototype"),
       nxt_string("true") },
@@ -9460,7 +9453,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Object.create(Math).hasOwnProperty('abs')"),
       nxt_string("false") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var m = Object.create(Math); m.abs = 3;"
                  "[m.hasOwnProperty('abs'), m.abs]"),
       nxt_string("true,3") },
@@ -9468,7 +9460,6 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("var m = Object.create(Math); m.abs = Math.floor;"
                  "[m.hasOwnProperty('abs'), delete m.abs, m.abs(-1)]"),
       nxt_string("true,true,1") },
-#endif
 
     { nxt_string("Object.getOwnPropertyDescriptor({a:1}, 'a').value"),
       nxt_string("1") },
@@ -9935,6 +9926,35 @@ static njs_unit_test_t  njs_test[] =
 
       nxt_string("true") },
 
+    { nxt_string(
+        "var fail;"
+        "function isWritableMethods(o) {"
+        "    var except = ["
+        "        'prototype',"
+        "    ];"
+        "    return Object.getOwnPropertyNames(o)"
+        "                 .filter(v => !except.includes(v)"
+        "                              && typeof o[v] == 'function')"
+        "                 .every(v => Object.getOwnPropertyDescriptor(o, v)"
+        "                                   .writable"
+        "                             || !(fail = `${o.name}.${v}`));"
+        "}"
+        "["
+        "    Boolean, Boolean.prototype,"
+        "    Number, Number.prototype,"
+        "    String, String.prototype,"
+        "    Object, Object.prototype,"
+        "    Array, Array.prototype,"
+        "    Function, Function.prototype,"
+        "    RegExp, RegExp.prototype,"
+        "    Date, Date.prototype,"
+        "    Error, Error.prototype,"
+        "    Math,"
+        "    JSON,"
+        "].every(obj => isWritableMethods(obj)) || fail"),
+
+      nxt_string("true") },
+
     { nxt_string("new Date(undefined)"),
       nxt_string("Invalid Date") },
 
@@ -11884,10 +11904,8 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("JSON.stringify(URIError('e'))"),
       nxt_string("{}") },
 
-#if 0  /* Most built-in methods and properties must be writable. */
     { nxt_string("var e = URIError('e'); e.name = 'E'; JSON.stringify(e)"),
       nxt_string("{\"name\":\"E\"}") },
-#endif
 
     { nxt_string("var e = URIError('e'); e.message = 'E'; JSON.stringify(e)"),
       nxt_string("{}") },