diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-06-05 11:08:12 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-06-07 17:01:47 +0200 |
commit | 6dbd6f6c7d0fe5629c921a2fe618ce9c00544294 (patch) | |
tree | db2fa9c18b76f9297a4aadfc3d46b7dca6c11a57 /deps/v8/src/intl.cc | |
parent | f54a598b44b9e75c32310552ec5b1ea5400142a5 (diff) | |
download | android-node-v8-6dbd6f6c7d0fe5629c921a2fe618ce9c00544294.tar.gz android-node-v8-6dbd6f6c7d0fe5629c921a2fe618ce9c00544294.tar.bz2 android-node-v8-6dbd6f6c7d0fe5629c921a2fe618ce9c00544294.zip |
deps: patch V8 to 6.7.288.44
Refs: https://github.com/v8/v8/compare/6.7.288.43...6.7.288.44
PR-URL: https://github.com/nodejs/node/pull/21146
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/intl.cc')
-rw-r--r-- | deps/v8/src/intl.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/deps/v8/src/intl.cc b/deps/v8/src/intl.cc index 5c2cb4e8fe..139bb4daf5 100644 --- a/deps/v8/src/intl.cc +++ b/deps/v8/src/intl.cc @@ -358,17 +358,17 @@ ICUTimezoneCache::~ICUTimezoneCache() { Clear(); } const char* ICUTimezoneCache::LocalTimezone(double time_ms) { bool is_dst = DaylightSavingsOffset(time_ms) != 0; - char* name = is_dst ? dst_timezone_name_ : timezone_name_; - if (name[0] == '\0') { + std::string* name = is_dst ? &dst_timezone_name_ : &timezone_name_; + if (name->empty()) { icu::UnicodeString result; GetTimeZone()->getDisplayName(is_dst, icu::TimeZone::LONG, result); result += '\0'; - icu::CheckedArrayByteSink byte_sink(name, kMaxTimezoneChars); + icu::StringByteSink<std::string> byte_sink(name); result.toUTF8(byte_sink); - CHECK(!byte_sink.Overflowed()); } - return const_cast<const char*>(name); + DCHECK(!name->empty()); + return name->c_str(); } icu::TimeZone* ICUTimezoneCache::GetTimeZone() { @@ -418,8 +418,8 @@ double ICUTimezoneCache::LocalTimeOffset(double time_ms, bool is_utc) { void ICUTimezoneCache::Clear() { delete timezone_; timezone_ = nullptr; - timezone_name_[0] = '\0'; - dst_timezone_name_[0] = '\0'; + timezone_name_.clear(); + dst_timezone_name_.clear(); } } // namespace internal |