Skip to content

Commit b67c416

Browse files
author
Fabrice Bellard
committed
fixed Proxy getOwnPropertyDescriptor with getters and setters
1 parent 82d86b1 commit b67c416

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

quickjs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46327,6 +46327,14 @@ static int js_proxy_get_own_property(JSContext *ctx, JSPropertyDescriptor *pdesc
4632746327
if (res < 0)
4632846328
return -1;
4632946329

46330+
/* convert the result_desc.flags to property flags */
46331+
if (result_desc.flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
46332+
result_desc.flags |= JS_PROP_GETSET;
46333+
} else {
46334+
result_desc.flags |= JS_PROP_NORMAL;
46335+
}
46336+
result_desc.flags &= (JS_PROP_C_W_E | JS_PROP_TMASK);
46337+
4633046338
if (target_desc_ret) {
4633146339
/* convert result_desc.flags to defineProperty flags */
4633246340
flags1 = result_desc.flags | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE;

0 commit comments

Comments
 (0)