Index: src/runtime/runtime-typedarray.cc |
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc |
index d8d3e5f848c11993b68149967e89edceec9f566b..14b120747afa235c3260358e16904f517d375bf0 100644 |
--- a/src/runtime/runtime-typedarray.cc |
+++ b/src/runtime/runtime-typedarray.cc |
@@ -28,6 +28,14 @@ RUNTIME_FUNCTION(Runtime_ArrayBufferSliceImpl) { |
CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, target, 1); |
CONVERT_NUMBER_ARG_HANDLE_CHECKED(first, 2); |
CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3); |
+ |
+ if (source->was_neutered() || target->was_neutered()) { |
+ THROW_NEW_ERROR_RETURN_FAILURE( |
+ isolate, NewTypeError(MessageTemplate::kDetachedOperation, |
+ isolate->factory()->NewStringFromAsciiChecked( |
+ "ArrayBuffer.prototype.slice"))); |
+ } |
+ |
RUNTIME_ASSERT(!source.is_identical_to(target)); |
size_t start = 0, target_length = 0; |
RUNTIME_ASSERT(TryNumberToSize(isolate, *first, &start)); |