From: Fabrice Bellard Date: Sat, 31 Oct 2026 17:44:04 +0000 (+0100) Subject: update DataView.prototype.[byteLength|byteOffset] not to throw when the view is out... X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=af0af7f0f0efb29a5e8d87e0a5a75fa5680e9a1f;p=quickjs.git update DataView.prototype.[byteLength|byteOffset] not to throw when the view is out of bounds (spec change) --- 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); }