Skip to content

Commit c638925

Browse files
committed
Add JS_ObjectSeal method
1 parent a236c4c commit c638925

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

quickjs.c

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

37211+
JSValue JS_ObjectSeal(JSContext *ctx, JSValue obj, int freeze)
37212+
{
37213+
JS_FreeValue(ctx, js_object_seal(ctx, JS_UNDEFINED, 1, &obj, freeze));
37214+
return obj;
37215+
}
37216+
3721137217
static JSValue js_object_fromEntries(JSContext *ctx, JSValue this_val,
3721237218
int argc, JSValue *argv)
3721337219
{

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, JSValue 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)