Skip to content

Commit 4d28bad

Browse files
committed
Remove SAB support from bjson module
1 parent 48ececf commit 4d28bad

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

docs/docs/stdlib.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Supported flags:
5656

5757
- `READ_OBJ_BYTECODE`: allow de-serializing functions and modules
5858
- `READ_OBJ_REFERENCE`: allow de-serializing object references
59-
- `READ_OBJ_SAB`: allow de-serializing SharedArrayBuffer instances
6059

6160
## `qjs:os` module
6261

quickjs-libc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4853,6 +4853,7 @@ static JSValue js_bjson_read(JSContext *ctx, JSValueConst this_val,
48534853
return JS_EXCEPTION;
48544854
if (JS_ToInt32(ctx, &flags, argv[3]))
48554855
return JS_EXCEPTION;
4856+
flags &= ~JS_READ_OBJ_SAB;
48564857
buf = JS_GetArrayBuffer(ctx, &size, argv[0]);
48574858
if (!buf)
48584859
return JS_EXCEPTION;
@@ -4872,6 +4873,7 @@ static JSValue js_bjson_write(JSContext *ctx, JSValueConst this_val,
48724873

48734874
if (JS_ToInt32(ctx, &flags, argv[1]))
48744875
return JS_EXCEPTION;
4876+
flags &= ~JS_WRITE_OBJ_SAB;
48754877
buf = JS_WriteObject(ctx, &len, argv[0], flags);
48764878
if (!buf)
48774879
return JS_EXCEPTION;
@@ -4887,10 +4889,8 @@ static const JSCFunctionListEntry js_bjson_funcs[] = {
48874889
#define DEF(x) JS_PROP_INT32_DEF(#x, JS_##x, JS_PROP_CONFIGURABLE)
48884890
DEF(READ_OBJ_BYTECODE),
48894891
DEF(READ_OBJ_REFERENCE),
4890-
DEF(READ_OBJ_SAB),
48914892
DEF(WRITE_OBJ_BYTECODE),
48924893
DEF(WRITE_OBJ_REFERENCE),
4893-
DEF(WRITE_OBJ_SAB),
48944894
DEF(WRITE_OBJ_STRIP_DEBUG),
48954895
DEF(WRITE_OBJ_STRIP_SOURCE),
48964896
#undef DEF

0 commit comments

Comments
 (0)