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

Unified Diff: test/mjsunit/date.js

Issue 1567353002: [date] Migrate Date field accessors to native builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar work. ports. Created 4 years, 11 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/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/date.js
diff --git a/test/mjsunit/date.js b/test/mjsunit/date.js
index 1c637f7fe36d83ed13248a7ccf769cea56e13cb5..257d99ca9e94a9b6f86a8f9c4e8a5ea3157a0142 100644
--- a/test/mjsunit/date.js
+++ b/test/mjsunit/date.js
@@ -328,18 +328,11 @@ assertThrows('Date.prototype.setHours.call("", 1, 2, 3, 4);', TypeError);
assertThrows('Date.prototype.getDate.call("");', TypeError);
assertThrows('Date.prototype.getUTCDate.call("");', TypeError);
-var date = new Date();
-date.getTime();
-date.getTime();
-%OptimizeFunctionOnNextCall(Date.prototype.getTime);
-assertThrows(function() { Date.prototype.getTime.call(""); }, TypeError);
-assertUnoptimized(Date.prototype.getTime);
-
-date.getYear();
-date.getYear();
-%OptimizeFunctionOnNextCall(Date.prototype.getYear);
-assertThrows(function() { Date.prototype.getYear.call(""); }, TypeError);
-assertUnoptimized(Date.prototype.getYear);
+assertThrows(function() { Date.prototype.getTime.call(0) }, TypeError);
+assertThrows(function() { Date.prototype.getTime.call("") }, TypeError);
+
+assertThrows(function() { Date.prototype.getYear.call(0) }, TypeError);
+assertThrows(function() { Date.prototype.getYear.call("") }, TypeError);
(function TestDatePrototypeOrdinaryObject() {
assertEquals(Object.prototype, Date.prototype.__proto__);
@@ -353,7 +346,7 @@ delete Date.prototype.getUTCHours;
delete Date.prototype.getUTCMinutes;
delete Date.prototype.getUTCSeconds;
delete Date.prototype.getUTCMilliseconds;
-date.toISOString();
+(new Date()).toISOString();
(function TestDeleteToString() {
assertTrue(delete Date.prototype.toString);
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698