@@ -1215,7 +1215,6 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
1215
1215
JSValue src_obj,
1216
1216
int classid, uint32_t len);
1217
1217
static BOOL typed_array_is_oob(JSObject *p);
1218
- static BOOL typed_array_is_resizable(JSObject *p);
1219
1218
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p);
1220
1219
static JSValue JS_ThrowTypeErrorDetachedArrayBuffer(JSContext *ctx);
1221
1220
static JSValue JS_ThrowTypeErrorArrayBufferOOB(JSContext *ctx);
@@ -9034,14 +9033,9 @@ static int JS_SetPropertyValue(JSContext *ctx, JSValue this_obj,
9034
9033
if (unlikely(idx >= (uint32_t)p->u.array.count)) {
9035
9034
ta_out_of_bound:
9036
9035
if (typed_array_is_oob(p))
9037
- if (!(flags & JS_PROP_DEFINE_PROPERTY))
9038
- return TRUE; // per spec: no OOB exception
9039
- // XXX(bnoordhuis) questionable but generic methods like
9040
- // Array.prototype.fill invoked on RABs can end up here
9041
- // and should, per spec, not error
9042
- if (typed_array_is_resizable(p))
9043
- return TRUE;
9044
- return JS_ThrowTypeErrorOrFalse(ctx, flags, "out-of-bound numeric index");
9036
+ if (flags & JS_PROP_DEFINE_PROPERTY)
9037
+ return JS_ThrowTypeErrorOrFalse(ctx, flags, "out-of-bound numeric index");
9038
+ return TRUE; // per spec: no OOB exception
9045
9039
}
9046
9040
p->u.array.u.double_ptr[idx] = d;
9047
9041
break;
@@ -51745,20 +51739,6 @@ static BOOL typed_array_is_oob(JSObject *p)
51745
51739
return end > len;
51746
51740
}
51747
51741
51748
- // |p| must be a typed array, *not* a DataView
51749
- static BOOL typed_array_is_resizable(JSObject *p)
51750
- {
51751
- JSArrayBuffer *abuf;
51752
- JSTypedArray *ta;
51753
-
51754
- assert(p->class_id >= JS_CLASS_UINT8C_ARRAY);
51755
- assert(p->class_id <= JS_CLASS_FLOAT64_ARRAY);
51756
-
51757
- ta = p->u.typed_array;
51758
- abuf = ta->buffer->u.array_buffer;
51759
- return array_buffer_is_resizable(abuf);
51760
- }
51761
-
51762
51742
/* WARNING: 'p' must be a typed array. Works even if the array buffer
51763
51743
is detached */
51764
51744
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p)
0 commit comments