return ret;
}
+ buffer = njs_typed_array_buffer(array);
+ if (njs_slow_path(njs_is_detached_buffer(buffer))) {
+ return NJS_OK;
+ }
+
buffer = njs_typed_array_writable(vm, array);
if (njs_slow_path(buffer == NULL)) {
return NJS_ERROR;
tarray = njs_typed_array(value);
if (njs_slow_path(njs_is_detached_buffer(tarray->buffer))) {
- njs_type_error(vm, "detached buffer");
- return NJS_ERROR;
+ goto not_found;
}
if (njs_slow_path(index >= njs_typed_array_length(tarray))) {
break;
case NJS_DECLINED:
+not_found:
njs_set_undefined(retval);
return NJS_DECLINED;