Skip to content

Commit

Permalink
test buffer ctor creation
Browse files Browse the repository at this point in the history
  • Loading branch information
xeioex committed Sep 7, 2024
1 parent d531608 commit e62e638
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/qjs_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2492,10 +2492,12 @@ qjs_new_uint8_array(JSContext *ctx, int argc, JSValueConst *argv)
#ifdef NJS_HAVE_QUICKJS_NEW_TYPED_ARRAY
ret = JS_NewTypedArray(ctx, argc, argv, JS_TYPED_ARRAY_UINT8);
#else
JSValue ctor;
JSValue global, ctor;

ctor = JS_GetClassProto(ctx, qjs_uint8_array_ctor_id);
global = JS_GetGlobalObject(ctx);
ctor = JS_GetPropertyStr(ctx, global, "Uint8Array");
ret = JS_CallConstructor(ctx, ctor, argc, argv);
JS_FreeValue(ctx, global);
JS_FreeValue(ctx, ctor);
#endif

Expand Down

0 comments on commit e62e638

Please sign in to comment.