From: Fabrice Bellard Date: Mon, 9 Nov 2026 14:28:18 +0000 (+0100) Subject: fixed JS_GetTypedArrayBuffer() length reporting with resizable array buffers (#608) X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=56d38b8e90eb74f36cd75e3e63506bde9827df67;p=quickjs.git fixed JS_GetTypedArrayBuffer() length reporting with resizable array buffers (#608) --- diff --git a/quickjs.c b/quickjs.c index 9c67217..8f36a55 100644 --- a/quickjs.c +++ b/quickjs.c @@ -61535,7 +61535,7 @@ JSValue JS_GetTypedArrayBuffer(JSContext *ctx, JSValueConst obj, if (pbyte_offset) *pbyte_offset = ta->offset; if (pbyte_length) - *pbyte_length = ta->length; + *pbyte_length = (size_t)p->u.array.count << typed_array_size_log2(p->class_id); if (pbytes_per_element) { *pbytes_per_element = 1 << typed_array_size_log2(p->class_id); }