| Index: runtime/vm/os_macos.cc
|
| diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
|
| index a7ea2f04f3446c0a8b7c94edcd60dba96f279121..94470b508e9a50eeb46279c63318f9cea518817c 100644
|
| --- a/runtime/vm/os_macos.cc
|
| +++ b/runtime/vm/os_macos.cc
|
| @@ -29,17 +29,17 @@ 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 : "";
|
| }
|
|
|
|
|
| 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.
|
| - return static_cast<int>(decomposed.tm_gmtoff);
|
| + // If unsuccessful, return zero like V8 does.
|
| + return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0;
|
| }
|
|
|
|
|
|
|