From 67bd99bf778beb6af68b3aa7dfd0f5d01cc75124 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 17 Feb 2020 16:18:18 +0300 Subject: [PATCH] Style: removing excessive commentaries. --- src/njs_array.c | 10 ------ src/njs_array_buffer.c | 5 --- src/njs_boolean.c | 3 -- src/njs_date.c | 3 -- src/njs_dtoa_fixed.c | 10 ------ src/njs_error.c | 27 ----------------- src/njs_function.c | 10 ------ src/njs_math.c | 17 ----------- src/njs_number.c | 12 -------- src/njs_object.c | 26 ---------------- src/njs_regexp.c | 3 -- src/njs_string.c | 69 ------------------------------------------ src/njs_symbol.c | 18 ----------- 13 files changed, 213 deletions(-) diff --git a/src/njs_array.c b/src/njs_array.c index 59c3b7e4..35765bba 100644 --- a/src/njs_array.c +++ b/src/njs_array.c @@ -444,7 +444,6 @@ njs_array_of(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_array_constructor_properties[] = { - /* Array.name == "Array". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -452,7 +451,6 @@ static const njs_object_prop_t njs_array_constructor_properties[] = .configurable = 1, }, - /* Array.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -460,14 +458,12 @@ static const njs_object_prop_t njs_array_constructor_properties[] = .configurable = 1, }, - /* Array.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* Array.isArray(). */ { .type = NJS_PROPERTY, .name = njs_string("isArray"), @@ -476,8 +472,6 @@ static const njs_object_prop_t njs_array_constructor_properties[] = .configurable = 1, }, - /* ES6. */ - /* Array.of(). */ { .type = NJS_PROPERTY, .name = njs_string("of"), @@ -3403,7 +3397,6 @@ static const njs_object_prop_t njs_array_prototype_properties[] = .configurable = 1, }, - /* ES7. */ { .type = NJS_PROPERTY, .name = njs_string("includes"), @@ -3436,7 +3429,6 @@ static const njs_object_prop_t njs_array_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("fill"), @@ -3453,7 +3445,6 @@ static const njs_object_prop_t njs_array_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("find"), @@ -3462,7 +3453,6 @@ static const njs_object_prop_t njs_array_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("findIndex"), diff --git a/src/njs_array_buffer.c b/src/njs_array_buffer.c index bf85a968..6394e674 100644 --- a/src/njs_array_buffer.c +++ b/src/njs_array_buffer.c @@ -112,7 +112,6 @@ njs_array_buffer_is_view(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_array_buffer_constructor_properties[] = { - /* ArrayBuffer.name == "ArrayBuffer". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -120,7 +119,6 @@ static const njs_object_prop_t njs_array_buffer_constructor_properties[] = .configurable = 1, }, - /* ArrayBuffer.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -128,14 +126,12 @@ static const njs_object_prop_t njs_array_buffer_constructor_properties[] = .configurable = 1, }, - /* ArrayBuffer.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* ArrayBuffer[Symbol.species] */ { .type = NJS_PROPERTY, .name = njs_wellknown_symbol(NJS_SYMBOL_SPECIES), @@ -147,7 +143,6 @@ static const njs_object_prop_t njs_array_buffer_constructor_properties[] = .enumerable = 0, }, - /* ArrayBuffer.isView(new Uint8Array()) === true */ { .type = NJS_PROPERTY, .name = njs_string("isView"), diff --git a/src/njs_boolean.c b/src/njs_boolean.c index 6d328fae..48d52d58 100644 --- a/src/njs_boolean.c +++ b/src/njs_boolean.c @@ -40,7 +40,6 @@ njs_boolean_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_boolean_constructor_properties[] = { - /* Boolean.name == "Boolean". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -48,7 +47,6 @@ static const njs_object_prop_t njs_boolean_constructor_properties[] = .configurable = 1, }, - /* Boolean.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -56,7 +54,6 @@ static const njs_object_prop_t njs_boolean_constructor_properties[] = .configurable = 1, }, - /* Boolean.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), diff --git a/src/njs_date.c b/src/njs_date.c index 93244b91..e19be507 100644 --- a/src/njs_date.c +++ b/src/njs_date.c @@ -1057,7 +1057,6 @@ njs_date_number_parse(int64_t *value, const u_char *p, const u_char *end, static const njs_object_prop_t njs_date_constructor_properties[] = { - /* Date.name == "Date". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -1065,7 +1064,6 @@ static const njs_object_prop_t njs_date_constructor_properties[] = .configurable = 1, }, - /* Date.length == 7. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -1073,7 +1071,6 @@ static const njs_object_prop_t njs_date_constructor_properties[] = .configurable = 1, }, - /* Date.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), diff --git a/src/njs_dtoa_fixed.c b/src/njs_dtoa_fixed.c index eac815f3..f97c4a72 100644 --- a/src/njs_dtoa_fixed.c +++ b/src/njs_dtoa_fixed.c @@ -378,16 +378,6 @@ njs_fixed_dtoa(double value, njs_uint_t frac, char *start, njs_int_t *point) dividend = significand; - /* - * Let v = f * 2^e with f == significand and e == exponent. - * Then need q (quotient) and r (remainder) as follows: - * f * 2^e = q * 5^17 * 2^17 + r - * If e > 17 then - * f * 2^(e-17) = q * 5^17 + r/2^17 - * else - * f = q * 5^17 * 2^(17-e) + r/2^e - */ - if (exponent > 17) { /* (e - 17) <= 3. */ dividend <<= exponent - 17; diff --git a/src/njs_error.c b/src/njs_error.c index b005ac58..60af3c5f 100644 --- a/src/njs_error.c +++ b/src/njs_error.c @@ -297,7 +297,6 @@ njs_error_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_error_constructor_properties[] = { - /* Error.name == "Error". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -305,7 +304,6 @@ static const njs_object_prop_t njs_error_constructor_properties[] = .configurable = 1, }, - /* Error.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -313,7 +311,6 @@ static const njs_object_prop_t njs_error_constructor_properties[] = .configurable = 1, }, - /* Error.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -338,7 +335,6 @@ njs_eval_error_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_eval_error_constructor_properties[] = { - /* EvalError.name == "EvalError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -346,7 +342,6 @@ static const njs_object_prop_t njs_eval_error_constructor_properties[] = .configurable = 1, }, - /* EvalError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -354,7 +349,6 @@ static const njs_object_prop_t njs_eval_error_constructor_properties[] = .configurable = 1, }, - /* EvalError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -379,7 +373,6 @@ njs_internal_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_internal_error_constructor_properties[] = { - /* InternalError.name == "InternalError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -387,7 +380,6 @@ static const njs_object_prop_t njs_internal_error_constructor_properties[] = .configurable = 1, }, - /* InternalError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -395,7 +387,6 @@ static const njs_object_prop_t njs_internal_error_constructor_properties[] = .configurable = 1, }, - /* InternalError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -420,7 +411,6 @@ njs_range_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_range_error_constructor_properties[] = { - /* RangeError.name == "RangeError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -428,7 +418,6 @@ static const njs_object_prop_t njs_range_error_constructor_properties[] = .configurable = 1, }, - /* RangeError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -436,7 +425,6 @@ static const njs_object_prop_t njs_range_error_constructor_properties[] = .configurable = 1, }, - /* RangeError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -461,7 +449,6 @@ njs_reference_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_reference_error_constructor_properties[] = { - /* ReferenceError.name == "ReferenceError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -469,7 +456,6 @@ static const njs_object_prop_t njs_reference_error_constructor_properties[] = .configurable = 1, }, - /* ReferenceError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -477,7 +463,6 @@ static const njs_object_prop_t njs_reference_error_constructor_properties[] = .configurable = 1, }, - /* ReferenceError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -502,7 +487,6 @@ njs_syntax_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_syntax_error_constructor_properties[] = { - /* SyntaxError.name == "SyntaxError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -510,7 +494,6 @@ static const njs_object_prop_t njs_syntax_error_constructor_properties[] = .configurable = 1, }, - /* SyntaxError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -518,7 +501,6 @@ static const njs_object_prop_t njs_syntax_error_constructor_properties[] = .configurable = 1, }, - /* SyntaxError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -543,7 +525,6 @@ njs_type_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_type_error_constructor_properties[] = { - /* TypeError.name == "TypeError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -551,7 +532,6 @@ static const njs_object_prop_t njs_type_error_constructor_properties[] = .configurable = 1, }, - /* TypeError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -559,7 +539,6 @@ static const njs_object_prop_t njs_type_error_constructor_properties[] = .configurable = 1, }, - /* TypeError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -584,7 +563,6 @@ njs_uri_error_constructor(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_uri_error_constructor_properties[] = { - /* URIError.name == "URIError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -592,7 +570,6 @@ static const njs_object_prop_t njs_uri_error_constructor_properties[] = .configurable = 1, }, - /* URIError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -600,7 +577,6 @@ static const njs_object_prop_t njs_uri_error_constructor_properties[] = .configurable = 1, }, - /* URIError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -686,7 +662,6 @@ njs_memory_error_prototype_create(njs_vm_t *vm, njs_object_prop_t *prop, static const njs_object_prop_t njs_memory_error_constructor_properties[] = { - /* MemoryError.name == "MemoryError". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -694,7 +669,6 @@ static const njs_object_prop_t njs_memory_error_constructor_properties[] = .configurable = 1, }, - /* MemoryError.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -702,7 +676,6 @@ static const njs_object_prop_t njs_memory_error_constructor_properties[] = .configurable = 1, }, - /* MemoryError.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), diff --git a/src/njs_function.c b/src/njs_function.c index ede96fe3..850c1f8d 100644 --- a/src/njs_function.c +++ b/src/njs_function.c @@ -217,9 +217,6 @@ njs_function_copy(njs_vm_t *vm, njs_function_t *function) } -/* - * ES5.1, 10.6: CreateArgumentsObject. - */ njs_int_t njs_function_arguments_object_init(njs_vm_t *vm, njs_native_frame_t *frame) { @@ -973,7 +970,6 @@ njs_function_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_function_constructor_properties[] = { - /* Function.name == "Function". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -981,7 +977,6 @@ static const njs_object_prop_t njs_function_constructor_properties[] = .configurable = 1, }, - /* Function.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -989,7 +984,6 @@ static const njs_object_prop_t njs_function_constructor_properties[] = .configurable = 1, }, - /* Function.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), @@ -1004,10 +998,6 @@ const njs_object_init_t njs_function_constructor_init = { }; -/* - * ES5.1, 15.3.5.1 length - * the typical number of arguments expected by the function. - */ static njs_int_t njs_function_instance_length(njs_vm_t *vm, njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval, njs_value_t *retval) diff --git a/src/njs_math.c b/src/njs_math.c index b8429194..01bada64 100644 --- a/src/njs_math.c +++ b/src/njs_math.c @@ -1063,7 +1063,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("acosh"), @@ -1080,7 +1079,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("asinh"), @@ -1105,7 +1103,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("atanh"), @@ -1114,7 +1111,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("cbrt"), @@ -1131,7 +1127,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("clz32"), @@ -1148,7 +1143,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("cosh"), @@ -1165,7 +1159,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("expm1"), @@ -1182,7 +1175,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("fround"), @@ -1191,7 +1183,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("hypot"), @@ -1200,7 +1191,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("imul"), @@ -1217,7 +1207,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("log10"), @@ -1226,7 +1215,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("log1p"), @@ -1235,7 +1223,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("log2"), @@ -1284,7 +1271,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("sign"), @@ -1301,7 +1287,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("sinh"), @@ -1326,7 +1311,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("tanh"), @@ -1335,7 +1319,6 @@ static const njs_object_prop_t njs_math_object_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("trunc"), diff --git a/src/njs_number.c b/src/njs_number.c index b8220f35..38b2d493 100644 --- a/src/njs_number.c +++ b/src/njs_number.c @@ -420,7 +420,6 @@ njs_number_is_finite(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_number_constructor_properties[] = { - /* Number.name == "Number". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -428,7 +427,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* Number.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -436,28 +434,24 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* Number.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("EPSILON"), .value = njs_value(NJS_NUMBER, 1, DBL_EPSILON), }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_long_string("MAX_SAFE_INTEGER"), .value = njs_value(NJS_NUMBER, 1, NJS_MAX_SAFE_INTEGER), }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_long_string("MIN_SAFE_INTEGER"), @@ -494,7 +488,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .value = njs_value(NJS_NUMBER, 1, -INFINITY), }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("isFinite"), @@ -503,7 +496,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("isInteger"), @@ -512,7 +504,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("isSafeInteger"), @@ -521,7 +512,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("isNaN"), @@ -530,7 +520,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("parseFloat"), @@ -539,7 +528,6 @@ static const njs_object_prop_t njs_number_constructor_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("parseInt"), diff --git a/src/njs_object.c b/src/njs_object.c index c9ea60c4..5e16fd47 100644 --- a/src/njs_object.c +++ b/src/njs_object.c @@ -2084,7 +2084,6 @@ njs_property_prototype_create(njs_vm_t *vm, njs_lvlhsh_t *hash, static const njs_object_prop_t njs_object_constructor_properties[] = { - /* Object.name == "Object". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -2092,7 +2091,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -2100,14 +2098,12 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* Object.create(). */ { .type = NJS_PROPERTY, .name = njs_string("create"), @@ -2116,7 +2112,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.keys(). */ { .type = NJS_PROPERTY, .name = njs_string("keys"), @@ -2125,7 +2120,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* ES8: Object.values(). */ { .type = NJS_PROPERTY, .name = njs_string("values"), @@ -2134,7 +2128,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* ES8: Object.entries(). */ { .type = NJS_PROPERTY, .name = njs_string("entries"), @@ -2143,7 +2136,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.defineProperty(). */ { .type = NJS_PROPERTY, .name = njs_string("defineProperty"), @@ -2152,7 +2144,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.defineProperties(). */ { .type = NJS_PROPERTY, .name = njs_long_string("defineProperties"), @@ -2161,7 +2152,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.getOwnPropertyDescriptor(). */ { .type = NJS_PROPERTY, .name = njs_long_string("getOwnPropertyDescriptor"), @@ -2170,7 +2160,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.getOwnPropertyDescriptors(). */ { .type = NJS_PROPERTY, .name = njs_long_string("getOwnPropertyDescriptors"), @@ -2180,7 +2169,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.getOwnPropertyNames(). */ { .type = NJS_PROPERTY, .name = njs_long_string("getOwnPropertyNames"), @@ -2190,7 +2178,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.getOwnPropertySymbols(). */ { .type = NJS_PROPERTY, .name = njs_long_string("getOwnPropertySymbols"), @@ -2200,7 +2187,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.getPrototypeOf(). */ { .type = NJS_PROPERTY, .name = njs_string("getPrototypeOf"), @@ -2209,7 +2195,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.setPrototypeOf(). */ { .type = NJS_PROPERTY, .name = njs_string("setPrototypeOf"), @@ -2218,7 +2203,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.freeze(). */ { .type = NJS_PROPERTY, .name = njs_string("freeze"), @@ -2227,7 +2211,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.isFrozen(). */ { .type = NJS_PROPERTY, .name = njs_string("isFrozen"), @@ -2236,7 +2219,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.seal(). */ { .type = NJS_PROPERTY, .name = njs_string("seal"), @@ -2245,7 +2227,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.isSealed(). */ { .type = NJS_PROPERTY, .name = njs_string("isSealed"), @@ -2254,7 +2235,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.preventExtensions(). */ { .type = NJS_PROPERTY, .name = njs_long_string("preventExtensions"), @@ -2263,7 +2243,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.isExtensible(). */ { .type = NJS_PROPERTY, .name = njs_string("isExtensible"), @@ -2272,7 +2251,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.assign(). */ { .type = NJS_PROPERTY, .name = njs_string("assign"), @@ -2281,7 +2259,6 @@ static const njs_object_prop_t njs_object_constructor_properties[] = .configurable = 1, }, - /* Object.is(). */ { .type = NJS_PROPERTY, .name = njs_string("is"), @@ -2298,9 +2275,6 @@ const njs_object_init_t njs_object_constructor_init = { }; -/* - * ES6, 9.1.2: [[SetPrototypeOf]]. - */ static njs_int_t njs_object_set_prototype(njs_vm_t *vm, njs_object_t *object, const njs_value_t *value) diff --git a/src/njs_regexp.c b/src/njs_regexp.c index 8947f78f..437e2615 100644 --- a/src/njs_regexp.c +++ b/src/njs_regexp.c @@ -1224,7 +1224,6 @@ njs_regexp_string_create(njs_vm_t *vm, njs_value_t *value, u_char *start, static const njs_object_prop_t njs_regexp_constructor_properties[] = { - /* RegExp.name == "RegExp". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -1232,7 +1231,6 @@ static const njs_object_prop_t njs_regexp_constructor_properties[] = .configurable = 1, }, - /* RegExp.length == 2. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -1240,7 +1238,6 @@ static const njs_object_prop_t njs_regexp_constructor_properties[] = .configurable = 1, }, - /* RegExp.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), diff --git a/src/njs_string.c b/src/njs_string.c index d1da45c2..59cc751d 100644 --- a/src/njs_string.c +++ b/src/njs_string.c @@ -581,7 +581,6 @@ njs_string_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, static const njs_object_prop_t njs_string_constructor_properties[] = { - /* String.name == "String". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -589,7 +588,6 @@ static const njs_object_prop_t njs_string_constructor_properties[] = .configurable = 1, }, - /* String.length == 1. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -597,14 +595,12 @@ static const njs_object_prop_t njs_string_constructor_properties[] = .configurable = 1, }, - /* String.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* String.bytesFrom(). */ { .type = NJS_PROPERTY, .name = njs_string("bytesFrom"), @@ -613,7 +609,6 @@ static const njs_object_prop_t njs_string_constructor_properties[] = .configurable = 1, }, - /* String.fromCharCode(). */ { .type = NJS_PROPERTY, .name = njs_string("fromCharCode"), @@ -622,7 +617,6 @@ static const njs_object_prop_t njs_string_constructor_properties[] = .configurable = 1, }, - /* String.fromCodePoint(), ECMAScript 6. */ { .type = NJS_PROPERTY, .name = njs_string("fromCodePoint"), @@ -869,11 +863,6 @@ njs_string_prototype_to_string(njs_vm_t *vm, njs_value_t *args, } -/* - * String.concat(string2[, ..., stringN]). - * JavaScript 1.2, ECMAScript 3. - */ - njs_int_t njs_string_prototype_concat(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -1168,11 +1157,6 @@ njs_string_prototype_to_bytes(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } -/* - * String.slice(start[, end]). - * JavaScript 1.2, ECMAScript 3. - */ - static njs_int_t njs_string_prototype_slice(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -1195,11 +1179,6 @@ njs_string_prototype_slice(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } -/* - * String.substring(start[, end]). - * JavaScript 1.0, ECMAScript 1. - */ - static njs_int_t njs_string_prototype_substring(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -1278,11 +1257,6 @@ njs_string_prototype_substring(njs_vm_t *vm, njs_value_t *args, } -/* - * String.substr(start[, length]). - * JavaScript 1.0, ECMAScript 3. - */ - static njs_int_t njs_string_prototype_substr(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -2552,7 +2526,6 @@ njs_string_offset_map_init(const u_char *start, size_t size) /* - * String.toLowerCase(). * The method supports only simple folding. For example, Turkish "İ" * folding "\u0130" to "\u0069\u0307" is not supported. */ @@ -2625,7 +2598,6 @@ njs_string_prototype_to_lower_case(njs_vm_t *vm, njs_value_t *args, /* - * String.toUpperCase(). * The method supports only simple folding. For example, German "ß" * folding "\u00DF" to "\u0053\u0053" is not supported. */ @@ -3053,10 +3025,6 @@ njs_string_prototype_pad(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } -/* - * String.search([regexp]) - */ - static njs_int_t njs_string_prototype_search(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -3137,10 +3105,6 @@ done: } -/* - * String.match([regexp]) - */ - static njs_int_t njs_string_prototype_match(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -3306,10 +3270,6 @@ njs_string_match_multiple(njs_vm_t *vm, njs_value_t *args, } -/* - * String.prototype.split([string|regexp[, limit]]) - */ - static njs_int_t njs_string_prototype_split(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -3510,10 +3470,6 @@ njs_string_split_part_add(njs_vm_t *vm, njs_array_t *array, njs_utf8_t utf8, } -/* - * String.replace([regexp|string[, string|function]]) - */ - static njs_int_t njs_string_prototype_replace(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -4638,7 +4594,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* String.codePointAt(), ECMAScript 6. */ { .type = NJS_PROPERTY, .name = njs_string("codePointAt"), @@ -4663,7 +4618,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("includes"), @@ -4672,7 +4626,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("startsWith"), @@ -4681,7 +4634,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("endsWith"), @@ -4714,7 +4666,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES10. */ { .type = NJS_PROPERTY, .name = njs_string("trimStart"), @@ -4723,7 +4674,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES10. */ { .type = NJS_PROPERTY, .name = njs_string("trimEnd"), @@ -4732,7 +4682,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES6. */ { .type = NJS_PROPERTY, .name = njs_string("repeat"), @@ -4741,7 +4690,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES8. */ { .type = NJS_PROPERTY, .name = njs_string("padStart"), @@ -4750,7 +4698,6 @@ static const njs_object_prop_t njs_string_prototype_properties[] = .configurable = 1, }, - /* ES8. */ { .type = NJS_PROPERTY, .name = njs_string("padEnd"), @@ -4815,10 +4762,6 @@ const njs_object_init_t njs_string_instance_init = { }; -/* - * encodeURI(string) - */ - njs_int_t njs_string_encode_uri(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -4863,10 +4806,6 @@ njs_string_encode_uri(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } -/* - * encodeURIComponent(string) - */ - njs_int_t njs_string_encode_uri_component(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -4970,10 +4909,6 @@ njs_string_encode(njs_vm_t *vm, njs_value_t *value, const uint32_t *escape) } -/* - * decodeURI(string) - */ - njs_int_t njs_string_decode_uri(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) @@ -5018,10 +4953,6 @@ njs_string_decode_uri(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } -/* - * decodeURIComponent(string) - */ - njs_int_t njs_string_decode_uri_component(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, njs_index_t unused) diff --git a/src/njs_symbol.c b/src/njs_symbol.c index 8d29ec56..8cc0764a 100644 --- a/src/njs_symbol.c +++ b/src/njs_symbol.c @@ -167,7 +167,6 @@ njs_symbol_key_for(njs_vm_t *vm, njs_value_t *args, static const njs_object_prop_t njs_symbol_constructor_properties[] = { - /* Symbol.name == "Symbol". */ { .type = NJS_PROPERTY, .name = njs_string("name"), @@ -175,7 +174,6 @@ static const njs_object_prop_t njs_symbol_constructor_properties[] = .configurable = 1, }, - /* Symbol.length == 0. */ { .type = NJS_PROPERTY, .name = njs_string("length"), @@ -183,14 +181,12 @@ static const njs_object_prop_t njs_symbol_constructor_properties[] = .configurable = 1, }, - /* Symbol.prototype. */ { .type = NJS_PROPERTY_HANDLER, .name = njs_string("prototype"), .value = njs_prop_handler(njs_object_prototype_create), }, - /* Symbol.for(). */ { .type = NJS_PROPERTY, .name = njs_string("for"), @@ -199,7 +195,6 @@ static const njs_object_prop_t njs_symbol_constructor_properties[] = .configurable = 1, }, - /* Symbol.keyFor(). */ { .type = NJS_PROPERTY, .name = njs_string("keyFor"), @@ -208,91 +203,78 @@ static const njs_object_prop_t njs_symbol_constructor_properties[] = .configurable = 1, }, - /* Symbol.asyncIterator. */ { .type = NJS_PROPERTY, .name = njs_string("asyncIterator"), .value = njs_wellknown_symbol(NJS_SYMBOL_ASYNC_ITERATOR), }, - /* Symbol.hasInstance. */ { .type = NJS_PROPERTY, .name = njs_string("hasInstance"), .value = njs_wellknown_symbol(NJS_SYMBOL_HAS_INSTANCE), }, - /* Symbol.isConcatSpreadable. */ { .type = NJS_PROPERTY, .name = njs_long_string("isConcatSpreadable"), .value = njs_wellknown_symbol(NJS_SYMBOL_IS_CONCAT_SPREADABLE), }, - /* Symbol.iterator. */ { .type = NJS_PROPERTY, .name = njs_string("iterator"), .value = njs_wellknown_symbol(NJS_SYMBOL_ITERATOR), }, - /* Symbol.match. */ { .type = NJS_PROPERTY, .name = njs_string("match"), .value = njs_wellknown_symbol(NJS_SYMBOL_MATCH), }, - /* Symbol.matchAll. */ { .type = NJS_PROPERTY, .name = njs_string("matchAll"), .value = njs_wellknown_symbol(NJS_SYMBOL_MATCH_ALL), }, - /* Symbol.replace. */ { .type = NJS_PROPERTY, .name = njs_string("replace"), .value = njs_wellknown_symbol(NJS_SYMBOL_REPLACE), }, - /* Symbol.search. */ { .type = NJS_PROPERTY, .name = njs_string("search"), .value = njs_wellknown_symbol(NJS_SYMBOL_SEARCH), }, - /* Symbol.species. */ { .type = NJS_PROPERTY, .name = njs_string("species"), .value = njs_wellknown_symbol(NJS_SYMBOL_SPECIES), }, - /* Symbol.split. */ { .type = NJS_PROPERTY, .name = njs_string("split"), .value = njs_wellknown_symbol(NJS_SYMBOL_SPLIT), }, - /* Symbol.toPrimitive. */ { .type = NJS_PROPERTY, .name = njs_string("toPrimitive"), .value = njs_wellknown_symbol(NJS_SYMBOL_TO_PRIMITIVE), }, - /* Symbol.toStringTag. */ { .type = NJS_PROPERTY, .name = njs_string("toStringTag"), .value = njs_wellknown_symbol(NJS_SYMBOL_TO_STRING_TAG), }, - /* Symbol.unscopables. */ { .type = NJS_PROPERTY, .name = njs_string("unscopables"), -- 2.47.3