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

Unified Diff: lib/runtime/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2010873002: Add types for valueFromDecomposedDate (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: formatting Created 4 years, 7 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:
Download patch
« no previous file with comments | « no previous file | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index f2b528799a3707004b24d305ffea8cad46681e98..d04b6c236c7b90cf376557fcbedf21c8cf16fde7 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -10029,17 +10029,17 @@ dart_library.library('dart_sdk', null, /* Imports */[
_js_helper.checkInt(seconds);
_js_helper.checkInt(milliseconds);
_js_helper.checkBool(isUtc);
- let jsMonth = dart.dsend(month, '-', 1);
+ let jsMonth = dart.notNull(month) - 1;
let value = null;
if (dart.test(isUtc)) {
value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseconds);
} else {
value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseconds).valueOf();
}
- if (dart.test(dart.dload(value, 'isNaN')) || dart.test(dart.dsend(value, '<', -MAX_MILLISECONDS_SINCE_EPOCH)) || dart.test(dart.dsend(value, '>', MAX_MILLISECONDS_SINCE_EPOCH))) {
+ if (dart.test(value[dartx.isNaN]) || dart.notNull(value) < -MAX_MILLISECONDS_SINCE_EPOCH || dart.notNull(value) > MAX_MILLISECONDS_SINCE_EPOCH) {
return null;
}
- if (dart.test(dart.dsend(years, '<=', 0)) || dart.test(dart.dsend(years, '<', 100))) return _js_helper.Primitives.patchUpY2K(value, years, isUtc);
+ if (dart.notNull(years) <= 0 || dart.notNull(years) < 100) return dart.as(_js_helper.Primitives.patchUpY2K(value, years, isUtc), core.num);
return value;
}
static patchUpY2K(value, years, isUtc) {
@@ -10126,7 +10126,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
flattenString: dart.definiteFunctionType(core.String, [core.String]),
getTimeZoneName: dart.definiteFunctionType(core.String, [core.DateTime]),
getTimeZoneOffsetInMinutes: dart.definiteFunctionType(core.int, [core.DateTime]),
- valueFromDecomposedDate: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic]),
+ valueFromDecomposedDate: dart.definiteFunctionType(core.num, [core.int, core.int, core.int, core.int, core.int, core.int, core.int, core.bool]),
patchUpY2K: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic, dart.dynamic]),
lazyAsJsDate: dart.definiteFunctionType(dart.dynamic, [core.DateTime]),
getYear: dart.definiteFunctionType(dart.dynamic, [core.DateTime]),
@@ -29115,7 +29115,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
this[_value$] = _js_helper.Primitives.dateNow();
}
static _brokenDownDateToValue(year, month, day, hour, minute, second, millisecond, microsecond, isUtc) {
- return dart.as(_js_helper.Primitives.valueFromDecomposedDate(year, month, day, hour, minute, second, dart.notNull(millisecond) + dart.notNull(core.DateTime._microsecondInRoundedMilliseconds(microsecond)), isUtc), core.int);
+ return dart.asInt(_js_helper.Primitives.valueFromDecomposedDate(year, month, day, hour, minute, second, dart.notNull(millisecond) + dart.notNull(core.DateTime._microsecondInRoundedMilliseconds(microsecond)), isUtc));
}
get millisecondsSinceEpoch() {
return this[_value$];
« no previous file with comments | « no previous file | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698