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

Unified Diff: src/harmony-array.js

Issue 1123353004: Revert of Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 3a46bad979cd559a7f23ebce9984de3dfb309513..5637917f2366865b44e656cba2dc3645b45fd9fe 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -18,7 +18,7 @@
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 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 @@
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 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 @@
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 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 @@
// 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 @@
%AddElement(result, k++, mappedValue, NONE);
}
} else {
- var len = $toLength(items.length);
- result = %IsConstructor(this) ? new this(len) : new GlobalArray(len);
+ var len = ToLength(items.length);
+ result = %IsConstructor(this) ? new this(len) : new $Array(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