Welcome! Log In Create A New Profile

Advanced

[njs] Made all constructor properties configurable.

Valentin Bartenev
May 07, 2019 01:42PM
details: https://hg.nginx.org/njs/rev/ff76f83fc49a
branches:
changeset: 957:ff76f83fc49a
user: Valentin Bartenev <vbart@nginx.com>
date: Tue May 07 20:41:07 2019 +0300
description:
Made all constructor properties configurable.

Note that actual "constructor" property is created on demand in the prototypes'
private hash with "configurable" option set. This change corrects its state
before any access.

diffstat:

njs/njs_array.c | 1 +
njs/njs_date.c | 1 +
njs/njs_error.c | 6 ++++++
njs/njs_regexp.c | 1 +
4 files changed, 9 insertions(+), 0 deletions(-)

diffs (84 lines):

diff -r 1b95bc101b4c -r ff76f83fc49a njs/njs_array.c
--- a/njs/njs_array.c Tue May 07 19:50:39 2019 +0300
+++ b/njs/njs_array.c Tue May 07 20:41:07 2019 +0300
@@ -2252,6 +2252,7 @@ static const njs_object_prop_t njs_arra
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},

{
diff -r 1b95bc101b4c -r ff76f83fc49a njs/njs_date.c
--- a/njs/njs_date.c Tue May 07 19:50:39 2019 +0300
+++ b/njs/njs_date.c Tue May 07 20:41:07 2019 +0300
@@ -1951,6 +1951,7 @@ static const njs_object_prop_t njs_date
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},

{
diff -r 1b95bc101b4c -r ff76f83fc49a njs/njs_error.c
--- a/njs/njs_error.c Tue May 07 19:50:39 2019 +0300
+++ b/njs/njs_error.c Tue May 07 20:41:07 2019 +0300
@@ -748,6 +748,7 @@ static const njs_object_prop_t njs_eval
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},
};

@@ -818,6 +819,7 @@ static const njs_object_prop_t njs_rang
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},
};

@@ -842,6 +844,7 @@ static const njs_object_prop_t njs_refe
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},
};

@@ -866,6 +869,7 @@ static const njs_object_prop_t njs_synt
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},
};

@@ -890,6 +894,7 @@ static const njs_object_prop_t njs_type
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},
};

@@ -907,6 +912,7 @@ static const njs_object_prop_t njs_uri_
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},

{
diff -r 1b95bc101b4c -r ff76f83fc49a njs/njs_regexp.c
--- a/njs/njs_regexp.c Tue May 07 19:50:39 2019 +0300
+++ b/njs/njs_regexp.c Tue May 07 20:41:07 2019 +0300
@@ -1019,6 +1019,7 @@ static const njs_object_prop_t njs_rege
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("constructor"),
.value = njs_prop_handler(njs_object_prototype_create_constructor),
+ .configurable = 1,
},

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

[njs] Made all constructor properties configurable.

Valentin Bartenev 170 May 07, 2019 01:42PM



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

Online Users

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