From af0af7f0f0efb29a5e8d87e0a5a75fa5680e9a1f Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Sat, 31 Oct 2026 18:44:04 +0100 Subject: [PATCH] update DataView.prototype.[byteLength|byteOffset] not to throw when the view is out of bounds (spec change) --- quickjs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickjs.c b/quickjs.c index 54eae1d..a824b57 100644 --- a/quickjs.c +++ b/quickjs.c @@ -63966,7 +63966,7 @@ static JSValue js_dataview_get_byteLength(JSContext *ctx, JSValueConst this_val) if (!p) return JS_EXCEPTION; if (dataview_is_oob(p)) - return JS_ThrowTypeErrorArrayBufferOOB(ctx); + return JS_NewInt32(ctx, 0); ta = p->u.typed_array; if (ta->track_rab) { abuf = ta->buffer->u.array_buffer; @@ -63984,7 +63984,7 @@ static JSValue js_dataview_get_byteOffset(JSContext *ctx, JSValueConst this_val) if (!p) return JS_EXCEPTION; if (dataview_is_oob(p)) - return JS_ThrowTypeErrorArrayBufferOOB(ctx); + return JS_NewInt32(ctx, 0); ta = p->u.typed_array; return JS_NewUint32(ctx, ta->offset); } -- 2.47.3