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

Unified Diff: src/array.js

Issue 1065863003: Use array literals instead of array constructor in native javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase and fix Created 5 years, 8 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 | « no previous file | src/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index 12d2b4c22ae73127236c6e3c189a1e4eec7bf888..98531d5454c463e56107b7d03f61125b0eb55f9b 100644
--- a/src/array.js
+++ b/src/array.js
@@ -1521,9 +1521,9 @@ function SetUpArray() {
DONT_ENUM | READ_ONLY);
// Set up non-enumerable functions on the Array object.
- InstallFunctions($Array, DONT_ENUM, $Array(
+ InstallFunctions($Array, DONT_ENUM, [
"isArray", ArrayIsArray
- ));
+ ]);
var specialFunctions = %SpecialArrayFunctions();
@@ -1542,7 +1542,7 @@ function SetUpArray() {
// set their names.
// Manipulate the length of some of the functions to meet
// expectations set by ECMA-262 or Mozilla.
- InstallFunctions($Array.prototype, DONT_ENUM, $Array(
+ InstallFunctions($Array.prototype, DONT_ENUM, [
"toString", getFunction("toString", ArrayToString),
"toLocaleString", getFunction("toLocaleString", ArrayToLocaleString),
"join", getFunction("join", ArrayJoin),
@@ -1564,27 +1564,27 @@ function SetUpArray() {
"lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1),
"reduce", getFunction("reduce", ArrayReduce, 1),
"reduceRight", getFunction("reduceRight", ArrayReduceRight, 1)
- ));
+ ]);
%FinishArrayPrototypeSetup($Array.prototype);
// The internal Array prototype doesn't need to be fancy, since it's never
// exposed to user code.
// Adding only the functions that are actually used.
- SetUpLockedPrototype(InternalArray, $Array(), $Array(
+ SetUpLockedPrototype(InternalArray, $Array(), [
"concat", getFunction("concat", ArrayConcatJS),
"indexOf", getFunction("indexOf", ArrayIndexOf),
"join", getFunction("join", ArrayJoin),
"pop", getFunction("pop", ArrayPop),
"push", getFunction("push", ArrayPush),
"splice", getFunction("splice", ArraySplice)
- ));
+ ]);
- SetUpLockedPrototype(InternalPackedArray, $Array(), $Array(
+ SetUpLockedPrototype(InternalPackedArray, $Array(), [
"join", getFunction("join", ArrayJoin),
"pop", getFunction("pop", ArrayPop),
"push", getFunction("push", ArrayPush)
- ));
+ ]);
}
SetUpArray();
« no previous file with comments | « no previous file | src/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698