Index: src/builtins/builtins-typedarray.cc |
diff --git a/src/builtins/builtins-typedarray.cc b/src/builtins/builtins-typedarray.cc |
index ceed1730ef5947c9744ef8cd3e9395510a7bff3d..030289ca85db2044dc768bfad055bdb2989192d7 100644 |
--- a/src/builtins/builtins-typedarray.cc |
+++ b/src/builtins/builtins-typedarray.cc |
@@ -255,5 +255,20 @@ BUILTIN(TypedArrayPrototypeLastIndexOf) { |
return *isolate->factory()->NewNumberFromInt64(result.FromJust()); |
} |
+BUILTIN(TypedArrayPrototypeReverse) { |
+ HandleScope scope(isolate); |
+ |
+ Handle<JSTypedArray> array; |
+ const char* method = "%TypedArray%.prototype.reverse"; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method)); |
+ |
+ if (V8_UNLIKELY(array->WasNeutered())) return *array; |
+ |
+ ElementsAccessor* elements = array->GetElementsAccessor(); |
+ elements->Reverse(*array); |
+ return *array; |
+} |
+ |
} // namespace internal |
} // namespace v8 |