Index: src/builtins/builtins-typedarray.cc |
diff --git a/src/builtins/builtins-typedarray.cc b/src/builtins/builtins-typedarray.cc |
index 4c80efb7cf33a9171bad2f3df0c89b7871b75096..2adbc0ba63dd0834de632aac26619c41f441e1cd 100644 |
--- a/src/builtins/builtins-typedarray.cc |
+++ b/src/builtins/builtins-typedarray.cc |
@@ -169,18 +169,6 @@ void Builtins::Generate_TypedArrayPrototypeKeys( |
namespace { |
-MaybeHandle<JSTypedArray> ValidateTypedArray(Isolate* isolate, |
- Handle<Object> receiver, |
- const char* method_name) { |
- if (V8_UNLIKELY(!receiver->IsJSTypedArray())) { |
- const MessageTemplate::Template message = MessageTemplate::kNotTypedArray; |
- THROW_NEW_ERROR(isolate, NewTypeError(message), JSTypedArray); |
- } |
- |
- // TODO(caitp): throw if array.[[ViewedArrayBuffer]] is neutered (per v8:4648) |
- return Handle<JSTypedArray>::cast(receiver); |
-} |
- |
int64_t CapRelativeIndex(Handle<Object> num, int64_t minimum, int64_t maximum) { |
int64_t relative; |
if (V8_LIKELY(num->IsSmi())) { |
@@ -207,7 +195,7 @@ BUILTIN(TypedArrayPrototypeCopyWithin) { |
Handle<JSTypedArray> array; |
const char* method = "%TypedArray%.prototype.copyWithin"; |
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
- isolate, array, ValidateTypedArray(isolate, args.receiver(), method)); |
+ isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method)); |
if (V8_UNLIKELY(array->WasNeutered())) return *array; |