]> git.kaiwu.me - njs.git/commitdiff
Backed out changeset b3691d847ff4, reimplemented properly.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 22 Nov 2018 15:12:26 +0000 (18:12 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 22 Nov 2018 15:12:26 +0000 (18:12 +0300)
njs/njs_parser.c

index 1252df69efd34abffa5f8258dba52275ac0fd65b..14fffe4c49b1ad0615a8c97ed8a1ae3323d8f69c 100644 (file)
@@ -1696,23 +1696,7 @@ njs_parser_try_statement(njs_vm_t *vm, njs_parser_t *parser)
 
     parser->node = try;
 
-    switch (token) {
-
-    case NJS_TOKEN_SEMICOLON:
-    case NJS_TOKEN_LINE_END:
-        return njs_parser_token(parser);
-
-    case NJS_TOKEN_CLOSE_BRACE:
-    case NJS_TOKEN_END:
-        return token;
-
-    default:
-        if (parser->lexer->prev_token == NJS_TOKEN_LINE_END) {
-            return token;
-        }
-
-        return NJS_TOKEN_ILLEGAL;
-    }
+    return token;
 }
 
 
@@ -1758,7 +1742,23 @@ njs_parser_throw_statement(njs_vm_t *vm, njs_parser_t *parser)
 
     parser->code_size += sizeof(njs_vmcode_throw_t);
 
-    return token;
+    switch (token) {
+
+    case NJS_TOKEN_SEMICOLON:
+    case NJS_TOKEN_LINE_END:
+        return njs_parser_token(parser);
+
+    case NJS_TOKEN_CLOSE_BRACE:
+    case NJS_TOKEN_END:
+        return token;
+
+    default:
+        if (parser->lexer->prev_token == NJS_TOKEN_LINE_END) {
+            return token;
+        }
+
+        return NJS_TOKEN_ILLEGAL;
+    }
 }