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

Unified Diff: src/math.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 | « src/json.js ('k') | src/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
diff --git a/src/math.js b/src/math.js
index 20f36e6bb1ae7cd4dec997a941a45baa25a9446a..1a5a1056f83c9f88d5a3e2c0fbca920de76ff990 100644
--- a/src/math.js
+++ b/src/math.js
@@ -17,7 +17,6 @@ var $min;
%CheckIsBootstrapping();
var GlobalObject = global.Object;
-var GlobalArray = global.Array;
//-------------------------------------------------------------------
@@ -295,7 +294,7 @@ var Math = new MathConstructor();
%AddNamedProperty(Math, symbolToStringTag, "Math", READ_ONLY | DONT_ENUM);
// Set up math constants.
-InstallConstants(Math, GlobalArray(
+InstallConstants(Math, [
// ECMA-262, section 15.8.1.1.
"E", 2.7182818284590452354,
// ECMA-262, section 15.8.1.2.
@@ -308,11 +307,11 @@ InstallConstants(Math, GlobalArray(
"PI", 3.1415926535897932,
"SQRT1_2", 0.7071067811865476,
"SQRT2", 1.4142135623730951
-));
+]);
// Set up non-enumerable functions of the Math object and
// set their names.
-InstallFunctions(Math, DONT_ENUM, GlobalArray(
+InstallFunctions(Math, DONT_ENUM, [
"random", MathRandom,
"abs", MathAbs,
"acos", MathAcosJS,
@@ -339,7 +338,7 @@ InstallFunctions(Math, DONT_ENUM, GlobalArray(
"fround", MathFroundJS,
"clz32", MathClz32JS,
"cbrt", MathCbrt
-));
+]);
%SetInlineBuiltinFlag(MathAbs);
%SetInlineBuiltinFlag(MathAcosJS);
« no previous file with comments | « src/json.js ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698