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

Unified Diff: src/date.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/collection-iterator.js ('k') | src/harmony-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
diff --git a/src/date.js b/src/date.js
index eafe79850049efac1b5146f75d353de6bfd26fd5..877fc73d2cf66495c48d43c0d8d5dc854a85e601 100644
--- a/src/date.js
+++ b/src/date.js
@@ -250,7 +250,7 @@ function DatePrintString(date) {
// -------------------------------------------------------------------
// Reused output buffer. Used when parsing date strings.
-var parse_buffer = $Array(8);
+var parse_buffer = new InternalArray(8);
// ECMA 262 - 15.9.4.2
function DateParse(string) {
@@ -765,18 +765,18 @@ function CreateDate(time) {
%FunctionSetPrototype(GlobalDate, new GlobalDate(NAN));
// Set up non-enumerable properties of the Date object itself.
-InstallFunctions(GlobalDate, DONT_ENUM, $Array(
+InstallFunctions(GlobalDate, DONT_ENUM, [
"UTC", DateUTC,
"parse", DateParse,
"now", DateNow
-));
+]);
// Set up non-enumerable constructor property of the Date prototype object.
%AddNamedProperty(GlobalDate.prototype, "constructor", GlobalDate, DONT_ENUM);
// Set up non-enumerable functions of the Date prototype object and
// set their names.
-InstallFunctions(GlobalDate.prototype, DONT_ENUM, $Array(
+InstallFunctions(GlobalDate.prototype, DONT_ENUM, [
"toString", DateToString,
"toDateString", DateToDateString,
"toTimeString", DateToTimeString,
@@ -823,7 +823,7 @@ InstallFunctions(GlobalDate.prototype, DONT_ENUM, $Array(
"setYear", DateSetYear,
"toISOString", DateToISOString,
"toJSON", DateToJSON
-));
+]);
// Expose to the global scope.
$createDate = CreateDate;
« no previous file with comments | « src/collection-iterator.js ('k') | src/harmony-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698