Welcome! Log In Create A New Profile

Advanced

[njs] Parser: fixed broken for expressions parsing.

Alexander Borisov
June 25, 2020 06:12AM
details: https://hg.nginx.org/njs/rev/fac632b520fa
branches:
changeset: 1440:fac632b520fa
user: Alexander Borisov <alexander.borisov@nginx.com>
date: Thu Jun 25 13:10:04 2020 +0300
description:
Parser: fixed broken for expressions parsing.

diffstat:

src/njs_parser.c | 2 +-
src/test/njs_unit_test.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r d692284e0b9f -r fac632b520fa src/njs_parser.c
--- a/src/njs_parser.c Thu Jun 25 13:10:03 2020 +0300
+++ b/src/njs_parser.c Thu Jun 25 13:10:04 2020 +0300
@@ -5218,7 +5218,7 @@ njs_parser_iteration_statement_for_map(n

njs_parser_next(parser, njs_parser_expression);

- return njs_parser_after(parser, current, NULL, 0,
+ return njs_parser_after(parser, current, NULL, 1,
njs_parser_for_expression);
}

diff -r d692284e0b9f -r fac632b520fa src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c Thu Jun 25 13:10:03 2020 +0300
+++ b/src/test/njs_unit_test.c Thu Jun 25 13:10:04 2020 +0300
@@ -17040,6 +17040,9 @@ static njs_unit_test_t njs_test[] =

{ njs_str("`${{f(){-} - {}}`"),
njs_str("SyntaxError: Unexpected token \"}\" in 1") },
+
+ { njs_str("for (;1-;) {}"),
+ njs_str("SyntaxError: Unexpected token \";\" in 1") },
};


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Parser: fixed broken for expressions parsing.

Alexander Borisov 80 June 25, 2020 06:12AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 59
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready