From: Dmitry Volyntsev Date: Sat, 22 Jun 2024 02:14:35 +0000 (-0700) Subject: Fixed attribute initialization for external properties. X-Git-Tag: 0.8.6~44 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=286d00b93ffa54958aab9a930a844ba4ba83f095;p=njs.git Fixed attribute initialization for external properties. --- 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") }, };