From 64c55c6dafb40a2d2cdb1e7f373ed901dd771273 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Fri, 3 Oct 2025 16:52:17 +0200 Subject: [PATCH] removed JS_PROP_NO_ADD --- quickjs.c | 14 +++----------- quickjs.h | 3 +-- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/quickjs.c b/quickjs.c index 9c04108..8446742 100644 --- a/quickjs.c +++ b/quickjs.c @@ -8973,11 +8973,9 @@ static void js_free_desc(JSContext *ctx, JSPropertyDescriptor *desc) } /* return -1 in case of exception or TRUE or FALSE. Warning: 'val' is - freed by the function. 'flags' is a bitmask of JS_PROP_NO_ADD, - JS_PROP_THROW or JS_PROP_THROW_STRICT. If JS_PROP_NO_ADD is set, - the new property is not added and an error is raised. 'this_obj' is - the receiver. If obj != this_obj, then obj must be an object - (Reflect.set case). */ + freed by the function. 'flags' is a bitmask of JS_PROP_THROW and + JS_PROP_THROW_STRICT. 'this_obj' is the receiver. If obj != + this_obj, then obj must be an object (Reflect.set case). */ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj, JSAtom prop, JSValue val, JSValueConst this_obj, int flags) { @@ -9173,12 +9171,6 @@ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj, } } - if (unlikely(flags & JS_PROP_NO_ADD)) { - JS_FreeValue(ctx, val); - JS_ThrowReferenceErrorNotDefined(ctx, prop); - return -1; - } - if (unlikely(!p)) { JS_FreeValue(ctx, val); return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object"); diff --git a/quickjs.h b/quickjs.h index c8cd149..cad3652 100644 --- a/quickjs.h +++ b/quickjs.h @@ -319,8 +319,7 @@ static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int64_t d) (JS_SetProperty) */ #define JS_PROP_THROW_STRICT (1 << 15) -#define JS_PROP_NO_ADD (1 << 16) /* internal use */ -#define JS_PROP_NO_EXOTIC (1 << 17) /* internal use */ +#define JS_PROP_NO_EXOTIC (1 << 16) /* internal use */ #ifndef JS_DEFAULT_STACK_SIZE #define JS_DEFAULT_STACK_SIZE (1024 * 1024)