Welcome! Log In Create A New Profile

Advanced

[njs] Fixed attribute initialization for external properties.

Anonymous User
July 01, 2024 10:34PM
details: https://github.com/nginx/njs/commit/286d00b93ffa54958aab9a930a844ba4ba83f095
branches: master
commit: 286d00b93ffa54958aab9a930a844ba4ba83f095
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri, 21 Jun 2024 19:14:35 -0700
description:
Fixed attribute initialization for external properties.


---
src/njs_extern.c | 8 +++-----
src/test/njs_unit_test.c | 5 +++++
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/njs_extern.c b/src/njs_extern.c
index df51f9b7..9ec1c1c9 100644
--- a/src/njs_extern.c
+++ b/src/njs_extern.c
@@ -236,11 +236,9 @@ njs_external_prop_handler(njs_vm_t *vm, njs_object_prop_t *self,
return NJS_ERROR;
}

- if (slots != NULL) {
- prop->writable = slots->writable;
- prop->configurable = slots->configurable;
- prop->enumerable = slots->enumerable;
- }
+ prop->writable = self->writable;
+ prop->configurable = self->configurable;
+ prop->enumerable = self->enumerable;

lhq.value = prop;
njs_string_get(&self->name, &lhq.key);
diff --git a/src/test/njs_unit_test.c b/src/test/njs_unit_test.c
index 88f8083e..d78c5b71 100644
--- a/src/test/njs_unit_test.c
+++ b/src/test/njs_unit_test.c
@@ -21819,6 +21819,11 @@ static njs_unit_test_t njs_webcrypto_test[] =
{ njs_str("let buf = new Uint32Array(4);"
"buf === crypto.getRandomValues(buf)"),
njs_str("true") },
+
+ { njs_str("crypto.subtle;"
+ "var d = Object.getOwnPropertyDescriptor(crypto, 'subtle');"
+ "d.enumerable && !d.configurable && d.writable"),
+ njs_str("true") },
};


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

[njs] Fixed attribute initialization for external properties.

Anonymous User 132 July 01, 2024 10:34PM



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

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready