removed JS_PROP_NO_ADD

This commit is contained in:
Fabrice Bellard
2025-10-03 16:52:17 +02:00
parent 57f8ec0099
commit 64c55c6daf
2 changed files with 4 additions and 13 deletions

View File

@@ -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 /* 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, freed by the function. 'flags' is a bitmask of JS_PROP_THROW and
JS_PROP_THROW or JS_PROP_THROW_STRICT. If JS_PROP_NO_ADD is set, JS_PROP_THROW_STRICT. 'this_obj' is the receiver. If obj !=
the new property is not added and an error is raised. 'this_obj' is this_obj, then obj must be an object (Reflect.set case). */
the receiver. If obj != this_obj, then obj must be an object
(Reflect.set case). */
int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj, int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
JSAtom prop, JSValue val, JSValueConst this_obj, int flags) 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)) { if (unlikely(!p)) {
JS_FreeValue(ctx, val); JS_FreeValue(ctx, val);
return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object"); return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object");

View File

@@ -319,8 +319,7 @@ static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int64_t d)
(JS_SetProperty) */ (JS_SetProperty) */
#define JS_PROP_THROW_STRICT (1 << 15) #define JS_PROP_THROW_STRICT (1 << 15)
#define JS_PROP_NO_ADD (1 << 16) /* internal use */ #define JS_PROP_NO_EXOTIC (1 << 16) /* internal use */
#define JS_PROP_NO_EXOTIC (1 << 17) /* internal use */
#ifndef JS_DEFAULT_STACK_SIZE #ifndef JS_DEFAULT_STACK_SIZE
#define JS_DEFAULT_STACK_SIZE (1024 * 1024) #define JS_DEFAULT_STACK_SIZE (1024 * 1024)