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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10894009: Revert "Updated VM and JS versions of Date to allow underflow and overflow." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | runtime/lib/date_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index a6683fb3e5f0fa98aa9dd655418e9b30b6db3391..2f054e80b2d070f86c70c18db4e562e408bbd23c 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -438,11 +438,24 @@ class Primitives {
milliseconds, isUtc) {
checkInt(years);
checkInt(month);
+ if (month < 1 || 12 < month) throw new IllegalArgumentException(month);
checkInt(day);
+ if (day < 1 || 31 < day) throw new IllegalArgumentException(day);
checkInt(hours);
+ if (hours < 0 || 24 < hours) throw new IllegalArgumentException(hours);
checkInt(minutes);
+ if (minutes < 0 || 59 < minutes) {
+ throw new IllegalArgumentException(minutes);
+ }
checkInt(seconds);
+ if (seconds < 0 || 59 < seconds) {
+ // TODO(ahe): Leap seconds?
+ throw new IllegalArgumentException(seconds);
+ }
checkInt(milliseconds);
+ if (milliseconds < 0 || 999 < milliseconds) {
+ throw new IllegalArgumentException(milliseconds);
+ }
checkBool(isUtc);
var jsMonth = month - 1;
var value;
« no previous file with comments | « no previous file | runtime/lib/date_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698