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

Unified Diff: src/harmony-array.js

Issue 1126213002: Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix 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/debug-debugger.js ('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 5637917f2366865b44e656cba2dc3645b45fd9fe..3a46bad979cd559a7f23ebce9984de3dfb309513 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -18,7 +18,7 @@ function ArrayCopyWithin(target, start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin");
var array = TO_OBJECT_INLINE(this);
- var length = ToLength(array.length);
+ var length = $toLength(array.length);
target = TO_INTEGER(target);
var to;
@@ -70,8 +70,8 @@ function ArrayCopyWithin(target, start, end) {
function ArrayFind(predicate /* thisArg */) { // length == 1
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.find");
- var array = ToObject(this);
- var length = ToInteger(array.length);
+ var array = $toObject(this);
+ var length = $toInteger(array.length);
if (!IS_SPEC_FUNCTION(predicate)) {
throw MakeTypeError(kCalledNonCallable, predicate);
@@ -92,7 +92,7 @@ function ArrayFind(predicate /* thisArg */) { // length == 1
for (var i = 0; i < length; i++) {
if (i in array) {
var element = array[i];
- var newThisArg = needs_wrapper ? ToObject(thisArg) : thisArg;
+ var newThisArg = needs_wrapper ? $toObject(thisArg) : thisArg;
if (%_CallFunction(newThisArg, element, i, array, predicate)) {
return element;
}
@@ -107,8 +107,8 @@ function ArrayFind(predicate /* thisArg */) { // length == 1
function ArrayFindIndex(predicate /* thisArg */) { // length == 1
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.findIndex");
- var array = ToObject(this);
- var length = ToInteger(array.length);
+ var array = $toObject(this);
+ var length = $toInteger(array.length);
if (!IS_SPEC_FUNCTION(predicate)) {
throw MakeTypeError(kCalledNonCallable, predicate);
@@ -129,7 +129,7 @@ function ArrayFindIndex(predicate /* thisArg */) { // length == 1
for (var i = 0; i < length; i++) {
if (i in array) {
var element = array[i];
- var newThisArg = needs_wrapper ? ToObject(thisArg) : thisArg;
+ var newThisArg = needs_wrapper ? $toObject(thisArg) : thisArg;
if (%_CallFunction(newThisArg, element, i, array, predicate)) {
return i;
}
@@ -144,7 +144,7 @@ function ArrayFindIndex(predicate /* thisArg */) { // length == 1
function ArrayFill(value /* [, start [, end ] ] */) { // length == 1
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
- var array = ToObject(this);
+ var array = $toObject(this);
var length = TO_UINT32(array.length);
var i = 0;
@@ -184,7 +184,7 @@ function ArrayFill(value /* [, start [, end ] ] */) { // length == 1
// ES6, draft 10-14-14, section 22.1.2.1
function ArrayFrom(arrayLike, mapfn, receiver) {
- var items = ToObject(arrayLike);
+ var items = $toObject(arrayLike);
var mapping = !IS_UNDEFINED(mapfn);
if (mapping) {
@@ -232,8 +232,8 @@ function ArrayFrom(arrayLike, mapfn, receiver) {
%AddElement(result, k++, mappedValue, NONE);
}
} else {
- var len = ToLength(items.length);
- result = %IsConstructor(this) ? new this(len) : new $Array(len);
+ var len = $toLength(items.length);
+ result = %IsConstructor(this) ? new this(len) : new GlobalArray(len);
for (k = 0; k < len; ++k) {
nextValue = items[k];
« no previous file with comments | « src/debug-debugger.js ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698