Welcome! Log In Create A New Profile

Advanced

[njs] Fixed njs_is_accessor_descriptor().

Dmitry Volyntsev
August 08, 2019 07:22AM
details: https://hg.nginx.org/njs/rev/6caf4d7c0846
branches:
changeset: 1116:6caf4d7c0846
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Aug 08 14:19:54 2019 +0300
description:
Fixed njs_is_accessor_descriptor().

diffstat:

src/njs_object.h | 3 ++-
src/njs_value.h | 4 ++++
2 files changed, 6 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r e47f82b5f2ca -r 6caf4d7c0846 src/njs_object.h
--- a/src/njs_object.h Mon Aug 05 17:10:59 2019 +0300
+++ b/src/njs_object.h Thu Aug 08 14:19:54 2019 +0300
@@ -13,7 +13,8 @@


#define njs_is_accessor_descriptor(prop) \
- (njs_is_valid(&(prop)->getter) || njs_is_valid(&(prop)->setter))
+ (njs_is_function_or_undefined(&(prop)->getter) \
+ || njs_is_function_or_undefined(&(prop)->setter))


#define njs_is_generic_descriptor(prop) \
diff -r e47f82b5f2ca -r 6caf4d7c0846 src/njs_value.h
--- a/src/njs_value.h Mon Aug 05 17:10:59 2019 +0300
+++ b/src/njs_value.h Thu Aug 08 14:19:54 2019 +0300
@@ -537,6 +537,10 @@ typedef struct {
((value)->type == NJS_FUNCTION)


+#define njs_is_function_or_undefined(value) \
+ ((value)->type == NJS_FUNCTION || (value)->type == NJS_UNDEFINED)
+
+
#define njs_is_regexp(value) \
((value)->type == NJS_REGEXP)

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

[njs] Fixed njs_is_accessor_descriptor().

Dmitry Volyntsev 51 August 08, 2019 07:22AM



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

Online Users

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