Skip to content

Commit 82bdc29

Browse files
committed
Add JS_ObjectSeal method
1 parent a236c4c commit 82bdc29

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

quickjs.c

+7
Original file line numberDiff line numberDiff line change
@@ -37208,6 +37208,13 @@ static JSValue js_object_isSealed(JSContext *ctx, JSValue this_val,
3720837208
return JS_EXCEPTION;
3720937209
}
3721037210

37211+
JSValue JS_ObjectSeal(JSContext *ctx, JSValueConst obj, int freeze)
37212+
{
37213+
JSValueConst argv[] = {obj};
37214+
JS_FreeValue(ctx, js_object_seal(ctx, JS_UNDEFINED, 1, argv, freeze));
37215+
return obj;
37216+
}
37217+
3721137218
static JSValue js_object_fromEntries(JSContext *ctx, JSValue this_val,
3721237219
int argc, JSValue *argv)
3721337220
{

quickjs.h

+1
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ JS_EXTERN int JS_SetPrototype(JSContext *ctx, JSValue obj, JSValue proto_val);
705705
JS_EXTERN JSValue JS_GetPrototype(JSContext *ctx, JSValue val);
706706
JS_EXTERN int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres);
707707
JS_EXTERN int JS_SetLength(JSContext *ctx, JSValue obj, int64_t len);
708+
JS_EXTERN JSValue JS_ObjectSeal(JSContext *ctx, JSValueConst obj, int freeze);
708709

709710
#define JS_GPN_STRING_MASK (1 << 0)
710711
#define JS_GPN_SYMBOL_MASK (1 << 1)

0 commit comments

Comments
 (0)