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

Unified Diff: src/js/array.js

Issue 2405253006: [builtins] implement Array.prototype[@@iterator] in TFJ builtins (Closed)
Patch Set: latest round Created 4 years, 2 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/heap/objects-visiting.cc ('k') | src/js/array-iterator.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 d10e7f18b56debe553874e3b37fe87fc62d75372..e23810f4ded4af3bc6d7d2d1a16fa92d708029c2 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -1539,6 +1539,8 @@ var getFunction = function(name, jsBuiltin, len) {
return f;
};
+var ArrayValues = getFunction("values", null, 0);
+
// Set up non-enumerable functions of the Array.prototype object and
// set their names.
// Manipulate the length of some of the functions to meet
@@ -1568,9 +1570,14 @@ utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
"find", getFunction("find", ArrayFind, 1),
"findIndex", getFunction("findIndex", ArrayFindIndex, 1),
"fill", getFunction("fill", ArrayFill, 1),
- "includes", getFunction("includes", null, 1)
+ "includes", getFunction("includes", null, 1),
+ "keys", getFunction("keys", null, 0),
+ "entries", getFunction("entries", null, 0),
+ iteratorSymbol, ArrayValues
]);
+%FunctionSetName(ArrayValues, "values");
+
utils.InstallGetter(GlobalArray, speciesSymbol, ArraySpecies);
%FinishArrayPrototypeSetup(GlobalArray.prototype);
@@ -1614,6 +1621,7 @@ utils.Export(function(to) {
to.ArrayJoin = ArrayJoin;
to.ArrayPush = ArrayPush;
to.ArrayToString = ArrayToString;
+ to.ArrayValues = ArrayValues;
to.InnerArrayCopyWithin = InnerArrayCopyWithin;
to.InnerArrayEvery = InnerArrayEvery;
to.InnerArrayFill = InnerArrayFill;
@@ -1638,6 +1646,7 @@ utils.Export(function(to) {
"array_splice", ArraySplice,
"array_slice", ArraySlice,
"array_unshift", ArrayUnshift,
+ "array_values_iterator", ArrayValues,
]);
});
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/js/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698