Welcome! Log In Create A New Profile

Advanced

[njs] Improved njs_generate_typeof_operation().

Dmitry Volyntsev
December 29, 2018 02:34AM
details: https://hg.nginx.org/njs/rev/792dbba9b902
branches:
changeset: 707:792dbba9b902
user: hongzhidao <hongzhidao@gmail.com>
date: Sat Dec 29 01:43:44 2018 +0800
description:
Improved njs_generate_typeof_operation().

njs_variable_typeof() cannot fail.

diffstat:

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

diffs (24 lines):

diff -r c4ec36309dda -r 792dbba9b902 njs/njs_generator.c
--- a/njs/njs_generator.c Fri Dec 28 19:36:24 2018 +0300
+++ b/njs/njs_generator.c Sat Dec 29 01:43:44 2018 +0800
@@ -2103,19 +2103,13 @@ njs_generate_typeof_operation(njs_vm_t *
njs_parser_node_t *node)
{
nxt_int_t ret;
- njs_index_t index;
njs_parser_node_t *expr;
njs_vmcode_2addr_t *code;

expr = node->left;

if (expr->token == NJS_TOKEN_NAME) {
- index = njs_variable_typeof(vm, expr);
- if (nxt_slow_path(index == NJS_INDEX_ERROR)) {
- return NXT_ERROR;
- }
-
- expr->index = index;
+ expr->index = njs_variable_typeof(vm, expr);

} else {
ret = njs_generator(vm, generator, node->left);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Improved njs_generate_typeof_operation().

Dmitry Volyntsev 134 December 29, 2018 02:34AM



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

Online Users

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