Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: src/harmony-typedarray.js

Issue 1132723008: Implement %TypedArray%.reverse (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array.js ('k') | test/mjsunit/harmony/typedarray-reverse.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-typedarray.js
diff --git a/src/harmony-typedarray.js b/src/harmony-typedarray.js
index 90679e0c1fe1afffb6b6b7115e93719e02d7b0c1..59c9a79bd22144422d1bce9559c4cf1367dc37d8 100644
--- a/src/harmony-typedarray.js
+++ b/src/harmony-typedarray.js
@@ -90,6 +90,15 @@ function TypedArrayFindIndex(predicate, thisArg) {
}
%FunctionSetLength(TypedArrayFindIndex, 1);
+// ES6 draft 05-18-15, section 22.2.3.21
+function TypedArrayReverse() {
+ if (!%IsTypedArray(this)) throw MakeTypeError(kNotTypedArray);
+
+ var length = %_TypedArrayGetLength(this);
+
+ return $innerArrayReverse(this, length);
+}
+
// ES6 draft 08-24-14, section 22.2.2.2
function TypedArrayOf() {
@@ -140,7 +149,8 @@ macro EXTEND_TYPED_ARRAY(NAME)
"forEach", TypedArrayForEach,
"find", TypedArrayFind,
"findIndex", TypedArrayFindIndex,
- "fill", TypedArrayFill
+ "fill", TypedArrayFill,
+ "reverse", TypedArrayReverse
]);
endmacro
« no previous file with comments | « src/array.js ('k') | test/mjsunit/harmony/typedarray-reverse.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698