Index: sdk/lib/_internal/js_runtime/lib/core_patch.dart |
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart |
index e5e76bfa6478fc459621dd449463ed15e6fbaab9..45466e3055f79eed78d2b723c51b5bc045688002 100644 |
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart |
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart |
@@ -234,7 +234,8 @@ class DateTime { |
@patch |
DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, |
{bool isUtc: false}) |
- : this._withValue(millisecondsSinceEpoch, isUtc: isUtc); |
+ // `0 + millisecondsSinceEpoch` forces the inferred result to be non-null. |
+ : this._withValue(0 + millisecondsSinceEpoch, isUtc: isUtc); |
@patch |
DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch, |
@@ -318,7 +319,7 @@ class DateTime { |
int get millisecondsSinceEpoch => _value; |
@patch |
- int get microsecondsSinceEpoch => _value * 1000; |
+ int get microsecondsSinceEpoch => 1000 * _value; |
@patch |
int get year => Primitives.getYear(this); |