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

Unified Diff: src/js/array.js

Issue 2735563002: Migrate %TypedArray%.prototype.fill to C++ (Closed)
Patch Set: Merge branch 'master' into fill 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
« src/elements.cc ('K') | « src/elements.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 0af620c48d4ec2633accf39f9807c1b11ebf880a..6bd31a8ebeac261c33eb6df66bc6cb8de24f02af 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -1376,7 +1376,12 @@ function ArrayFindIndex(predicate, thisArg) {
// ES6, draft 04-05-14, section 22.1.3.6
-function InnerArrayFill(value, start, end, array, length) {
+function ArrayFill(value, start, end) {
+ CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
+
+ var array = TO_OBJECT(this);
+ var length = TO_LENGTH(array.length);
+
var i = IS_UNDEFINED(start) ? 0 : TO_INTEGER(start);
var end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
@@ -1404,17 +1409,6 @@ function InnerArrayFill(value, start, end, array, length) {
}
-// ES6, draft 04-05-14, section 22.1.3.6
-function ArrayFill(value, start, end) {
- CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
-
- var array = TO_OBJECT(this);
- var length = TO_LENGTH(array.length);
-
- return InnerArrayFill(value, start, end, array, length);
-}
-
-
// ES6, draft 10-14-14, section 22.1.2.1
function ArrayFrom(arrayLike, mapfn, receiver) {
var items = TO_OBJECT(arrayLike);
@@ -1618,7 +1612,6 @@ utils.Export(function(to) {
to.ArrayToString = ArrayToString;
to.ArrayValues = IteratorFunctions.values,
to.InnerArrayEvery = InnerArrayEvery;
- to.InnerArrayFill = InnerArrayFill;
to.InnerArrayFilter = InnerArrayFilter;
to.InnerArrayFind = InnerArrayFind;
to.InnerArrayFindIndex = InnerArrayFindIndex;
« src/elements.cc ('K') | « src/elements.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698