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

Unified Diff: pkg/intl/lib/src/date_format_helpers.dart

Issue 102443007: Add lots of debugging machinery for flaky datetime creation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes from review comments Created 7 years 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 | « pkg/intl/lib/intl.dart ('k') | pkg/intl/lib/src/temporary_debugging.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/src/date_format_helpers.dart
diff --git a/pkg/intl/lib/src/date_format_helpers.dart b/pkg/intl/lib/src/date_format_helpers.dart
index 253a4e61f2dc31824aa1781e3fdd77e3ae114d67..55085864a977f0240b554085e52794df8224963b 100644
--- a/pkg/intl/lib/src/date_format_helpers.dart
+++ b/pkg/intl/lib/src/date_format_helpers.dart
@@ -39,8 +39,22 @@ class _DateBuilder {
DateTime asDate() {
// TODO(alanknight): Validate the date, especially for things which
// can crash the VM, e.g. large month values.
+ if (debugLogDateCreation) {
+ debugDateCreationLog
+ ..write(" Creating Date from\n")
+ ..write(" UTC: $utc\n")
+ ..write(" year: $year\n")
+ ..write(" month: $month\n")
+ ..write(" day: $day\n")
+ ..write(" pm: $pm\n")
+ ..write(" hour: $hour\n")
+ ..write(" minute: $minute\n")
+ ..write(" second: $second\n")
+ ..write(" fractionalSecond: $fractionalSecond\n");
+ }
+ var result;
if (utc) {
- return new DateTime.utc(
+ result = new DateTime.utc(
year,
month,
day,
@@ -49,7 +63,7 @@ class _DateBuilder {
second,
fractionalSecond);
} else {
- return new DateTime(
+ result = new DateTime(
year,
month,
day,
@@ -58,6 +72,11 @@ class _DateBuilder {
second,
fractionalSecond);
}
+ if (debugLogDateCreation) {
+ debugDateCreationLog
+ ..write("Created $result");
+ }
+ return result;
}
}
« no previous file with comments | « pkg/intl/lib/intl.dart ('k') | pkg/intl/lib/src/temporary_debugging.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698