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

Unified Diff: src/js/array.js

Issue 2776433003: [builtins] Implement Array.prototype.reduceRight in the CSA (Closed)
Patch Set: Add back accidental removals Created 3 years, 9 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/debug/debug-evaluate.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/array.js
diff --git a/src/js/array.js b/src/js/array.js
index 68831d33e4e28dc99df19c4f2d2ce8e0d00f1118..cd239ba3f28241725c866777c538f43df1cf08d2 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -1106,45 +1106,6 @@ function ArrayLastIndexOf(element, index) {
return -1;
}
-function InnerArrayReduceRight(callback, current, array, length,
- argumentsLength) {
- if (!IS_CALLABLE(callback)) {
- throw %make_type_error(kCalledNonCallable, callback);
- }
-
- var i = length - 1;
- find_initial: if (argumentsLength < 2) {
- for (; i >= 0; i--) {
- if (i in array) {
- current = array[i--];
- break find_initial;
- }
- }
- throw %make_type_error(kReduceNoInitial);
- }
-
- for (; i >= 0; i--) {
- if (i in array) {
- var element = array[i];
- current = callback(current, element, i, array);
- }
- }
- return current;
-}
-
-
-function ArrayReduceRight(callback, current) {
- CHECK_OBJECT_COERCIBLE(this, "Array.prototype.reduceRight");
-
- // Pull out the length so that side effects are visible before the
- // callback function is checked.
- var array = TO_OBJECT(this);
- var length = TO_LENGTH(array.length);
- return InnerArrayReduceRight(callback, current, array, length,
- arguments.length);
-}
-
-
// ES#sec-array.prototype.copywithin
// (Array.prototype.copyWithin ( target, start [ , end ] )
function ArrayCopyWithin(target, start, end) {
@@ -1425,7 +1386,6 @@ utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
"map", getFunction("map", ArrayMap, 1),
"indexOf", getFunction("indexOf", null, 1),
"lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1),
- "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1),
"copyWithin", getFunction("copyWithin", ArrayCopyWithin, 2),
"find", getFunction("find", ArrayFind, 1),
"findIndex", getFunction("findIndex", ArrayFindIndex, 1),
@@ -1484,7 +1444,6 @@ utils.Export(function(to) {
to.InnerArrayFind = InnerArrayFind;
to.InnerArrayFindIndex = InnerArrayFindIndex;
to.InnerArrayJoin = InnerArrayJoin;
- to.InnerArrayReduceRight = InnerArrayReduceRight;
to.InnerArraySort = InnerArraySort;
to.InnerArrayToLocaleString = InnerArrayToLocaleString;
to.PackedArrayReverse = PackedArrayReverse;
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698