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

Unified Diff: src/harmony-array.js

Issue 1378533002: [es6] Introduce %ToInteger and %ToLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/globals.h ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 50da5f9b1f961fd403aa2ea2a396946ea980607d..0867f7cd46304cf1270c80b021b878d6842df47f 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -85,7 +85,7 @@ function ArrayCopyWithin(target, start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin");
var array = TO_OBJECT(this);
- var length = $toLength(array.length);
+ var length = TO_LENGTH(array.length);
return InnerArrayCopyWithin(target, start, end, array, length);
}
@@ -110,7 +110,7 @@ function ArrayFind(predicate, thisArg) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.find");
var array = TO_OBJECT(this);
- var length = $toInteger(array.length);
+ var length = TO_INTEGER(array.length);
return InnerArrayFind(predicate, thisArg, array, length);
}
@@ -135,7 +135,7 @@ function ArrayFindIndex(predicate, thisArg) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.findIndex");
var array = TO_OBJECT(this);
- var length = $toInteger(array.length);
+ var length = TO_INTEGER(array.length);
return InnerArrayFindIndex(predicate, thisArg, array, length);
}
@@ -233,7 +233,7 @@ function ArrayFrom(arrayLike, mapfn, receiver) {
k++;
}
} else {
- var len = $toLength(items.length);
+ var len = TO_LENGTH(items.length);
result = %IsConstructor(this) ? new this(len) : new GlobalArray(len);
for (k = 0; k < len; ++k) {
« no previous file with comments | « src/globals.h ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698