| 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 685226a4c9f969cbe9ca0704336a9feab31afc4d..41c8b7b154352ac5e36eae41890de13ecb87975c 100644
|
| --- a/lib/compiler/implementation/lib/js_helper.dart
|
| +++ b/lib/compiler/implementation/lib/js_helper.dart
|
| @@ -436,6 +436,7 @@ class Primitives {
|
|
|
| static valueFromDecomposedDate(years, month, day, hours, minutes, seconds,
|
| milliseconds, isUtc) {
|
| + final int MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
|
| checkInt(years);
|
| checkInt(month);
|
| checkInt(day);
|
| @@ -453,7 +454,11 @@ class Primitives {
|
| value = JS('num', @'new Date(#, #, #, #, #, #, #).valueOf()',
|
| years, jsMonth, day, hours, minutes, seconds, milliseconds);
|
| }
|
| - if (value.isNaN()) throw new IllegalArgumentException();
|
| + if (value.isNaN() ||
|
| + value < -MAX_MILLISECONDS_SINCE_EPOCH ||
|
| + value > MAX_MILLISECONDS_SINCE_EPOCH) {
|
| + throw new IllegalArgumentException();
|
| + }
|
| if (years <= 0 || years < 100) return patchUpY2K(value, years, isUtc);
|
| return value;
|
| }
|
|
|