diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-04-16 16:51:34 +0200 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-04-16 16:51:34 +0200 |
commit | b67c41689ebf4643f8db5b6dcbfafffd945d3e96 (patch) | |
tree | f8c86eaa3c240e0d07fceb65fa146063267436ca | |
parent | 82d86b11d2eece784650caf2d61d77a0baf3ae8c (diff) | |
download | quickjs-b67c41689ebf4643f8db5b6dcbfafffd945d3e96.tar.gz quickjs-b67c41689ebf4643f8db5b6dcbfafffd945d3e96.zip |
fixed Proxy getOwnPropertyDescriptor with getters and setters
-rw-r--r-- | quickjs.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -46327,6 +46327,14 @@ static int js_proxy_get_own_property(JSContext *ctx, JSPropertyDescriptor *pdesc if (res < 0) return -1; + /* convert the result_desc.flags to property flags */ + if (result_desc.flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) { + result_desc.flags |= JS_PROP_GETSET; + } else { + result_desc.flags |= JS_PROP_NORMAL; + } + result_desc.flags &= (JS_PROP_C_W_E | JS_PROP_TMASK); + if (target_desc_ret) { /* convert result_desc.flags to defineProperty flags */ flags1 = result_desc.flags | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE; |