Welcome! Log In Create A New Profile

Advanced

[njs] Improved parsing object literals.

Dmitry Volyntsev
February 01, 2019 10:28AM
details: https://hg.nginx.org/njs/rev/476bb5ed52e8
branches:
changeset: 751:476bb5ed52e8
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Feb 01 18:26:18 2019 +0300
description:
Improved parsing object literals.

diffstat:

njs/njs_parser.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diffs (31 lines):

diff -r 94fc00372558 -r 476bb5ed52e8 njs/njs_parser.c
--- a/njs/njs_parser.c Fri Feb 01 18:09:02 2019 +0300
+++ b/njs/njs_parser.c Fri Feb 01 18:26:18 2019 +0300
@@ -2151,6 +2151,13 @@ njs_parser_object(njs_vm_t *vm, njs_pars

left = NULL;

+ object = njs_parser_node_new(vm, parser, NJS_TOKEN_OBJECT_VALUE);
+ if (nxt_slow_path(object == NULL)) {
+ return NJS_TOKEN_ERROR;
+ }
+
+ object->u.object = obj;
+
for ( ;; ) {
token = njs_parser_property_token(parser);

@@ -2177,13 +2184,6 @@ njs_parser_object(njs_vm_t *vm, njs_pars
return token;
}

- object = njs_parser_node_new(vm, parser, NJS_TOKEN_OBJECT_VALUE);
- if (nxt_slow_path(object == NULL)) {
- return NJS_TOKEN_ERROR;
- }
-
- object->u.object = obj;
-
propref = njs_parser_node_new(vm, parser, NJS_TOKEN_PROPERTY);
if (nxt_slow_path(propref == NULL)) {
return NJS_TOKEN_ERROR;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Improved parsing object literals.

Dmitry Volyntsev 108 February 01, 2019 10:28AM



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

Online Users

Guests: 76
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