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

Unified Diff: src/harmony-array.js

Issue 1149773003: Revert of Revert of Hook up more import/exports in natives. (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/generator.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 00a1fa07eed3c69390bf6753bacf4b6dfbe897ea..5df1abde0ff05d60afdb8d54abfc66572333c570 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -2,12 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-var $innerArrayCopyWithin;
-var $innerArrayFill;
-var $innerArrayFind;
-var $innerArrayFindIndex;
-var $arrayFrom;
-
(function(global, utils) {
'use strict';
@@ -20,12 +14,18 @@
var GlobalArray = global.Array;
var GlobalSymbol = global.Symbol;
+var GetIterator;
+var GetMethod;
var MathMax;
var MathMin;
+var ObjectIsFrozen;
utils.Import(function(from) {
+ GetIterator = from.GetIterator;
+ GetMethod = from.GetMethod;
MathMax = from.MathMax;
MathMin = from.MathMin;
+ ObjectIsFrozen = from.ObjectIsFrozen;
});
// -------------------------------------------------------------------
@@ -76,7 +76,6 @@
return array;
}
-$innerArrayCopyWithin = InnerArrayCopyWithin;
// ES6 draft 03-17-15, section 22.1.3.3
function ArrayCopyWithin(target, start, end) {
@@ -112,7 +111,6 @@
return;
}
-$innerArrayFind = InnerArrayFind;
// ES6 draft 07-15-13, section 15.4.3.23
function ArrayFind(predicate, thisArg) {
@@ -148,7 +146,6 @@
return -1;
}
-$innerArrayFindIndex = InnerArrayFindIndex;
// ES6 draft 07-15-13, section 15.4.3.24
function ArrayFindIndex(predicate, thisArg) {
@@ -179,7 +176,7 @@
if (end > length) end = length;
}
- if ((end - i) > 0 && $objectIsFrozen(array)) {
+ if ((end - i) > 0 && ObjectIsFrozen(array)) {
throw MakeTypeError(kArrayFunctionsOnFrozen);
}
@@ -187,7 +184,6 @@
array[i] = value;
return array;
}
-$innerArrayFill = InnerArrayFill;
// ES6, draft 04-05-14, section 22.1.3.6
function ArrayFill(value, start, end) {
@@ -216,7 +212,7 @@
}
}
- var iterable = $getMethod(items, symbolIterator);
+ var iterable = GetMethod(items, symbolIterator);
var k;
var result;
var mappedValue;
@@ -225,7 +221,7 @@
if (!IS_UNDEFINED(iterable)) {
result = %IsConstructor(this) ? new this() : [];
- var iterator = $getIterator(items, iterable);
+ var iterator = GetIterator(items, iterable);
k = 0;
while (true) {
@@ -266,7 +262,6 @@
return result;
}
}
-$arrayFrom = ArrayFrom;
// ES6, draft 05-22-14, section 22.1.2.3
function ArrayOf() {
@@ -283,7 +278,7 @@
// -------------------------------------------------------------------
-$installConstants(GlobalSymbol, [
+utils.InstallConstants(GlobalSymbol, [
// TODO(dslomov, caitp): Move to symbol.js when shipping
"isConcatSpreadable", symbolIsConcatSpreadable
]);
@@ -295,17 +290,28 @@
%FunctionSetLength(ArrayFindIndex, 1);
// Set up non-enumerable functions on the Array object.
-$installFunctions(GlobalArray, DONT_ENUM, [
+utils.InstallFunctions(GlobalArray, DONT_ENUM, [
"from", ArrayFrom,
"of", ArrayOf
]);
// Set up the non-enumerable functions on the Array prototype object.
-$installFunctions(GlobalArray.prototype, DONT_ENUM, [
+utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
"copyWithin", ArrayCopyWithin,
"find", ArrayFind,
"findIndex", ArrayFindIndex,
"fill", ArrayFill
]);
+// -------------------------------------------------------------------
+// Exports
+
+utils.Export(function(to) {
+ to.ArrayFrom = ArrayFrom;
+ to.InnerArrayCopyWithin = InnerArrayCopyWithin;
+ to.InnerArrayFill = InnerArrayFill;
+ to.InnerArrayFind = InnerArrayFind;
+ to.InnerArrayFindIndex = InnerArrayFindIndex;
+});
+
})
« no previous file with comments | « src/generator.js ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698