[njs] Style.

Dmitry Volyntsev xeioex at nginx.com
Sun Mar 17 14:36:46 UTC 2019


details:   https://hg.nginx.org/njs/rev/9a87bf103c47
branches:  
changeset: 831:9a87bf103c47
user:      hongzhidao <hongzhidao at gmail.com>
date:      Sun Mar 17 21:22:30 2019 +0800
description:
Style.

diffstat:

 njs/njs_generator.c         |  4 ++--
 njs/njs_lexer.c             |  2 +-
 njs/njs_parser.c            |  6 +++---
 njs/njs_parser_expression.c |  2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diffs (75 lines):

diff -r 65109fd228e0 -r 9a87bf103c47 njs/njs_generator.c
--- a/njs/njs_generator.c	Sun Mar 17 17:36:17 2019 +0300
+++ b/njs/njs_generator.c	Sun Mar 17 21:22:30 2019 +0800
@@ -2431,7 +2431,7 @@ njs_generate_argument_closures(njs_vm_t 
             n--;
         }
 
-    } while(n != 0);
+    } while (n != 0);
 
     return NXT_OK;
 }
@@ -2611,7 +2611,7 @@ njs_generate_method_call(njs_vm_t *vm, n
 
 static nxt_noinline nxt_int_t
 njs_generate_call(njs_vm_t *vm, njs_generator_t *generator,
-                  njs_parser_node_t *node)
+    njs_parser_node_t *node)
 {
     nxt_int_t                   ret;
     nxt_uint_t                  nargs;
diff -r 65109fd228e0 -r 9a87bf103c47 njs/njs_lexer.c
--- a/njs/njs_lexer.c	Sun Mar 17 17:36:17 2019 +0300
+++ b/njs/njs_lexer.c	Sun Mar 17 21:22:30 2019 +0800
@@ -404,7 +404,7 @@ njs_lexer_token_name_resolve(njs_lexer_t
 
         if (lexer->property) {
             lexer->property_token = lt->token;
-            return NJS_TOKEN_NAME;
+            lt->token = NJS_TOKEN_NAME;
         }
     }
 
diff -r 65109fd228e0 -r 9a87bf103c47 njs/njs_parser.c
--- a/njs/njs_parser.c	Sun Mar 17 17:36:17 2019 +0300
+++ b/njs/njs_parser.c	Sun Mar 17 21:22:30 2019 +0800
@@ -639,7 +639,7 @@ njs_parser_function_declaration(njs_vm_t
     }
 
     if (token != NJS_TOKEN_NAME) {
-        if (token == NJS_TOKEN_ARGUMENTS || token ==  NJS_TOKEN_EVAL) {
+        if (token == NJS_TOKEN_ARGUMENTS || token == NJS_TOKEN_EVAL) {
             njs_parser_syntax_error(vm, parser, "Identifier \"%V\" "
                                     "is forbidden in function declaration",
                                     njs_parser_text(parser));
@@ -1023,7 +1023,7 @@ njs_parser_var_statement(njs_vm_t *vm, n
         }
 
         if (token != NJS_TOKEN_NAME) {
-            if (token == NJS_TOKEN_ARGUMENTS || token ==  NJS_TOKEN_EVAL) {
+            if (token == NJS_TOKEN_ARGUMENTS || token == NJS_TOKEN_EVAL) {
                 njs_parser_syntax_error(vm, parser, "Identifier \"%V\" "
                                         "is forbidden in var declaration",
                                         njs_parser_text(parser));
@@ -1475,7 +1475,7 @@ njs_parser_for_var_statement(njs_vm_t *v
         }
 
         if (token != NJS_TOKEN_NAME) {
-            if (token == NJS_TOKEN_ARGUMENTS || token ==  NJS_TOKEN_EVAL) {
+            if (token == NJS_TOKEN_ARGUMENTS || token == NJS_TOKEN_EVAL) {
                 njs_parser_syntax_error(vm, parser, "Identifier \"%V\" "
                                        "is forbidden in for-in var declaration",
                                        njs_parser_text(parser));
diff -r 65109fd228e0 -r 9a87bf103c47 njs/njs_parser_expression.c
--- a/njs/njs_parser_expression.c	Sun Mar 17 17:36:17 2019 +0300
+++ b/njs/njs_parser_expression.c	Sun Mar 17 21:22:30 2019 +0800
@@ -354,7 +354,7 @@ njs_parser_assignment_expression(njs_vm_
         if (!njs_parser_is_lvalue(parser->node)) {
             token = parser->node->token;
 
-            if (token == NJS_TOKEN_ARGUMENTS || token ==  NJS_TOKEN_EVAL) {
+            if (token == NJS_TOKEN_ARGUMENTS || token == NJS_TOKEN_EVAL) {
                 njs_parser_syntax_error(vm, parser, "Identifier \"%s\" "
                                       "is forbidden as left-hand in assignment",
                                        (token == NJS_TOKEN_EVAL) ? "eval"


More information about the nginx-devel mailing list