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

Unified Diff: test/mjsunit/regress/regress-crbug-422858.js

Issue 1557053002: Accept time zones like GMT-8 in the legacy date parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test hours Created 4 years, 12 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/dateparser-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-422858.js
diff --git a/test/mjsunit/regress/regress-crbug-422858.js b/test/mjsunit/regress/regress-crbug-422858.js
new file mode 100644
index 0000000000000000000000000000000000000000..ba75fc01a439d4a01d98e32cd79e4bbdb8cb1b2d
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-422858.js
@@ -0,0 +1,23 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var date = new Date("2016/01/02 10:00 GMT-8")
+assertEquals(0, date.getMinutes());
+assertEquals(18, date.getUTCHours());
+
+date = new Date("2016/01/02 10:00 GMT-12")
+assertEquals(0, date.getMinutes());
+assertEquals(22, date.getUTCHours());
+
+date = new Date("2016/01/02 10:00 GMT-123")
+assertEquals(23, date.getMinutes());
+assertEquals(11, date.getUTCHours());
+
+date = new Date("2016/01/02 10:00 GMT-0856")
+assertEquals(56, date.getMinutes());
+assertEquals(18, date.getUTCHours());
+
+date = new Date("2016/01/02 10:00 GMT-08000")
+assertEquals(NaN, date.getMinutes());
+assertEquals(NaN, date.getUTCHours());
« no previous file with comments | « src/dateparser-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698