]> git.kaiwu.me - quickjs.git/commitdiff
removed JS_PROP_NO_ADD
authorFabrice Bellard <fabrice@bellard.org>
Fri, 3 Oct 2025 14:52:17 +0000 (16:52 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Fri, 3 Oct 2025 14:52:17 +0000 (16:52 +0200)
quickjs.c
quickjs.h

index 9c041084a5d8fc2b23fa3741a6f425a6a20e2b18..84467424f9a43e181fa7548f4eaf9befd0219da5 100644 (file)
--- 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");
index c8cd1494443129a146c7e95103a036f989a3a8f8..cad3652fbf2e0879d970e26d94293cb7c7ab81b6 100644 (file)
--- 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)