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

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

Issue 10536116: Reapply "Refactor Date implementation in VM." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 6 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 | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/mockimpl.dart
diff --git a/lib/compiler/implementation/lib/mockimpl.dart b/lib/compiler/implementation/lib/mockimpl.dart
index 08648b963210d8818313dab8ad876dd86f21a81e..b6f18055e7e65737ee6033ffd3f0a97f538179ab 100644
--- a/lib/compiler/implementation/lib/mockimpl.dart
+++ b/lib/compiler/implementation/lib/mockimpl.dart
@@ -243,8 +243,12 @@ class DateImplementation implements Date {
}
}
+ static final int _MAX_VALUE = 8640000000000000;
+
DateImplementation.fromEpoch(this.value, [bool isUtc = false])
- : _isUtc = checkNull(isUtc);
+ : _isUtc = checkNull(isUtc) {
+ if (value.abs() > _MAX_VALUE) throw new IllegalArgumentException(value);
+ }
bool operator ==(other) {
if (!(other is DateImplementation)) return false;
« no previous file with comments | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698