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

Unified Diff: tool/input_sdk/private/js_helper.dart

Issue 2010693002: Add a type on lazyAsJsDate (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Review fixes 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/js_helper.dart
diff --git a/tool/input_sdk/private/js_helper.dart b/tool/input_sdk/private/js_helper.dart
index 583816c43727d4b4153603fb81ddb58498a49284..72df8d86a2e0eef64a496a501987861452df142a 100644
--- a/tool/input_sdk/private/js_helper.dart
+++ b/tool/input_sdk/private/js_helper.dart
@@ -321,7 +321,7 @@ class Primitives {
return JS('String', "#.charCodeAt(0) == 0 ? # : #", str, str, str);
}
- static String getTimeZoneName(receiver) {
+ static String getTimeZoneName(DateTime receiver) {
// Firefox and Chrome emit the timezone in parenthesis.
// Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
// We extract this name using a regexp.
@@ -355,7 +355,7 @@ class Primitives {
return "";
}
- static int getTimeZoneOffsetInMinutes(receiver) {
+ static int getTimeZoneOffsetInMinutes(DateTime receiver) {
// Note that JS and Dart disagree on the sign of the offset.
return -JS('int', r'#.getTimezoneOffset()', lazyAsJsDate(receiver));
}
@@ -400,7 +400,7 @@ class Primitives {
}
// Lazily keep a JS Date stored in the JS object.
- static lazyAsJsDate(receiver) {
+ static lazyAsJsDate(DateTime receiver) {
if (JS('bool', r'#.date === (void 0)', receiver)) {
JS('void', r'#.date = new Date(#)', receiver,
receiver.millisecondsSinceEpoch);
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698