Chromium Code Reviews| Index: runtime/vm/os_android.cc |
| diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc |
| index 0d67d1450ff430d87942c10e0b3661edb89f6004..8e27ada33bf4730d04b520f7e93064711ba4eec4 100644 |
| --- a/runtime/vm/os_android.cc |
| +++ b/runtime/vm/os_android.cc |
| @@ -28,17 +28,16 @@ static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
| const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { |
| tm decomposed; |
| bool succeeded = LocalTime(seconds_since_epoch, &decomposed); |
| - ASSERT(succeeded); |
| - return decomposed.tm_zone; |
| + // If unsuccessful, return an empty string like V8 does. |
| + return succeeded && decomposed.tm_zone != NULL ? decomposed.tm_zone : ""; |
|
siva
2012/10/25 23:31:40
suggest parens for better readability
return (succ
Tom Ball
2012/10/25 23:38:11
Done.
|
| } |
| int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) { |
| tm decomposed; |
| bool succeeded = LocalTime(seconds_since_epoch, &decomposed); |
| - ASSERT(succeeded); |
| // Even if the offset was 24 hours it would still easily fit into 32 bits. |
|
siva
2012/10/25 23:31:40
Do we need to add the same comment here regarding
Tom Ball
2012/10/25 23:38:11
Done.
|
| - return static_cast<int>(decomposed.tm_gmtoff); |
| + return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0; |
| } |