From: Valentin Bartenev Date: Thu, 23 May 2019 12:05:51 +0000 (+0300) Subject: Made writable most of built-in properties and methods. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=67878cde423cffa6140a2ccfc453836ec1ad69d2;p=njs.git Made writable most of built-in properties and methods. --- diff --git a/njs/njs_array.c b/njs/njs_array.c index 0659a46c..efd05586 100644 --- a/njs/njs_array.c +++ b/njs/njs_array.c @@ -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, }, }; diff --git a/njs/njs_boolean.c b/njs/njs_boolean.c index 79a67778..4fbc47fc 100644 --- a/njs/njs_boolean.c +++ b/njs/njs_boolean.c @@ -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, }, }; diff --git a/njs/njs_crypto.c b/njs/njs_crypto.c index ba452e4a..99737105 100644 --- a/njs/njs_crypto.c +++ b/njs/njs_crypto.c @@ -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, }, diff --git a/njs/njs_date.c b/njs/njs_date.c index 99ecf373..e1ca585c 100644 --- a/njs/njs_date.c +++ b/njs/njs_date.c @@ -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, }, }; diff --git a/njs/njs_error.c b/njs/njs_error.c index a3deac74..82967adb 100644 --- a/njs/njs_error.c +++ b/njs/njs_error.c @@ -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, }, }; diff --git a/njs/njs_fs.c b/njs/njs_fs.c index 5e9d5cf5..3f897e2d 100644 --- a/njs/njs_fs.c +++ b/njs/njs_fs.c @@ -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, }, diff --git a/njs/njs_function.c b/njs/njs_function.c index ddf570f3..f649c2a4 100644 --- a/njs/njs_function.c +++ b/njs/njs_function.c @@ -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, }, }; diff --git a/njs/njs_json.c b/njs/njs_json.c index a2c33ece..aceffbd7 100644 --- a/njs/njs_json.c +++ b/njs/njs_json.c @@ -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, }, }; diff --git a/njs/njs_math.c b/njs/njs_math.c index c004f812..9b4ef2e5 100644 --- a/njs/njs_math.c +++ b/njs/njs_math.c @@ -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, }, }; diff --git a/njs/njs_number.c b/njs/njs_number.c index 7d63589b..8e16f7da 100644 --- a/njs/njs_number.c +++ b/njs/njs_number.c @@ -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, }, }; diff --git a/njs/njs_object.c b/njs/njs_object.c index d8fbdf85..46b15cd4 100644 --- a/njs/njs_object.c +++ b/njs/njs_object.c @@ -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, }, }; diff --git a/njs/njs_regexp.c b/njs/njs_regexp.c index 72854efb..ffd88518 100644 --- a/njs/njs_regexp.c +++ b/njs/njs_regexp.c @@ -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, }, }; diff --git a/njs/njs_string.c b/njs/njs_string.c index d6260794..a109887f 100644 --- a/njs/njs_string.c +++ b/njs/njs_string.c @@ -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, }, }; diff --git a/njs/test/njs_unit_test.c b/njs/test/njs_unit_test.c index fa5f8520..a3dc530c 100644 --- a/njs/test/njs_unit_test.c +++ b/njs/test/njs_unit_test.c @@ -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("{}") },