Skip to content

Commit 64c55c6

Browse files
author
Fabrice Bellard
committed
removed JS_PROP_NO_ADD
1 parent 57f8ec0 commit 64c55c6

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

quickjs.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8973,11 +8973,9 @@ static void js_free_desc(JSContext *ctx, JSPropertyDescriptor *desc)
89738973
}
89748974

89758975
/* return -1 in case of exception or TRUE or FALSE. Warning: 'val' is
8976-
freed by the function. 'flags' is a bitmask of JS_PROP_NO_ADD,
8977-
JS_PROP_THROW or JS_PROP_THROW_STRICT. If JS_PROP_NO_ADD is set,
8978-
the new property is not added and an error is raised. 'this_obj' is
8979-
the receiver. If obj != this_obj, then obj must be an object
8980-
(Reflect.set case). */
8976+
freed by the function. 'flags' is a bitmask of JS_PROP_THROW and
8977+
JS_PROP_THROW_STRICT. 'this_obj' is the receiver. If obj !=
8978+
this_obj, then obj must be an object (Reflect.set case). */
89818979
int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
89828980
JSAtom prop, JSValue val, JSValueConst this_obj, int flags)
89838981
{
@@ -9173,12 +9171,6 @@ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
91739171
}
91749172
}
91759173

9176-
if (unlikely(flags & JS_PROP_NO_ADD)) {
9177-
JS_FreeValue(ctx, val);
9178-
JS_ThrowReferenceErrorNotDefined(ctx, prop);
9179-
return -1;
9180-
}
9181-
91829174
if (unlikely(!p)) {
91839175
JS_FreeValue(ctx, val);
91849176
return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object");

quickjs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int64_t d)
319319
(JS_SetProperty) */
320320
#define JS_PROP_THROW_STRICT (1 << 15)
321321

322-
#define JS_PROP_NO_ADD (1 << 16) /* internal use */
323-
#define JS_PROP_NO_EXOTIC (1 << 17) /* internal use */
322+
#define JS_PROP_NO_EXOTIC (1 << 16) /* internal use */
324323

325324
#ifndef JS_DEFAULT_STACK_SIZE
326325
#define JS_DEFAULT_STACK_SIZE (1024 * 1024)

0 commit comments

Comments
 (0)