[njs] Using short string values where they are enough.

Igor Sysoev igor at sysoev.ru
Thu Dec 1 16:49:25 UTC 2016


details:   http://hg.nginx.org/njs/rev/f8f20b27724e
branches:  
changeset: 270:f8f20b27724e
user:      Igor Sysoev <igor at sysoev.ru>
date:      Thu Dec 01 19:45:19 2016 +0300
description:
Using short string values where they are enough.

diffstat:

 njs/njs_date.c   |  28 ++++++++++++++--------------
 njs/njs_object.c |   3 +--
 2 files changed, 15 insertions(+), 16 deletions(-)

diffs (136 lines):

diff -r 6d0d4a92fa02 -r f8f20b27724e njs/njs_date.c
--- a/njs/njs_date.c	Thu Dec 01 18:56:35 2016 +0300
+++ b/njs/njs_date.c	Thu Dec 01 19:45:19 2016 +0300
@@ -2097,7 +2097,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setTime"),
+        .name = njs_string("setTime"),
         .value = njs_native_function(njs_date_prototype_set_time, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
     },
@@ -2118,21 +2118,21 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setSeconds"),
+        .name = njs_string("setSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCSeconds"),
+        .name = njs_string("setUTCSeconds"),
         .value = njs_native_function(njs_date_prototype_set_seconds, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setMinutes"),
+        .name = njs_string("setMinutes"),
         .value = njs_native_function(njs_date_prototype_set_minutes, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
@@ -2140,7 +2140,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCMinutes"),
+        .name = njs_string("setUTCMinutes"),
         .value = njs_native_function(njs_date_prototype_set_utc_minutes, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
@@ -2148,7 +2148,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setHours"),
+        .name = njs_string("setHours"),
         .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),
@@ -2156,7 +2156,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCHours"),
+        .name = njs_string("setUTCHours"),
         .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),
@@ -2164,35 +2164,35 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setDate"),
+        .name = njs_string("setDate"),
         .value = njs_native_function(njs_date_prototype_set_date, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCDate"),
+        .name = njs_string("setUTCDate"),
         .value = njs_native_function(njs_date_prototype_set_utc_date, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setMonth"),
+        .name = njs_string("setMonth"),
         .value = njs_native_function(njs_date_prototype_set_month, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCMonth"),
+        .name = njs_string("setUTCMonth"),
         .value = njs_native_function(njs_date_prototype_set_utc_month, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG),
     },
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setFullYear"),
+        .name = njs_string("setFullYear"),
         .value = njs_native_function(njs_date_prototype_set_full_year, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
@@ -2200,7 +2200,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("setUTCFullYear"),
+        .name = njs_string("setUTCFullYear"),
         .value = njs_native_function(njs_date_prototype_set_utc_full_year, 0,
                      NJS_DATE_ARG, NJS_NUMBER_ARG, NJS_NUMBER_ARG,
                      NJS_NUMBER_ARG),
@@ -2208,7 +2208,7 @@ static const njs_object_prop_t  njs_date
 
     {
         .type = NJS_METHOD,
-        .name = njs_long_string("toJSON"),
+        .name = njs_string("toJSON"),
         .value = njs_native_function(njs_date_prototype_to_json,
                      NJS_CONTINUATION_SIZE, 0),
     },
diff -r 6d0d4a92fa02 -r f8f20b27724e njs/njs_object.c
--- a/njs/njs_object.c	Thu Dec 01 18:56:35 2016 +0300
+++ b/njs/njs_object.c	Thu Dec 01 19:45:19 2016 +0300
@@ -603,8 +603,7 @@ static const njs_value_t  njs_object_fun
                                      njs_long_string("[object Function]");
 static const njs_value_t  njs_object_regexp_string =
                                      njs_long_string("[object RegExp]");
-static const njs_value_t  njs_object_date_string =
-                                     njs_long_string("[object Date]");
+static const njs_value_t  njs_object_date_string = njs_string("[object Date]");
 
 
 njs_ret_t



More information about the nginx-devel mailing list