Commit 00038e19 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

Fix Use-of-uninitialized-value

v8::internal::JSDateTimeFormat::New

Bug: chromium:1177812, chromium:1177623
Change-Id: I91e6babd796c6735e96e3cd1541d8aba51aaefee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2706353
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72878}
parent e01256e7
......@@ -437,7 +437,7 @@ std::string CanonicalizeTimeZoneID(const std::string& input) {
title[1] = 'S';
}
return title;
} else if (memcmp(upper.c_str(), "SYSTEMV/", 8) == 0) {
} else if (strncmp(upper.c_str(), "SYSTEMV/", 8) == 0) {
upper.replace(0, 8, "SystemV/");
return upper;
}
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertEquals("UTC", Intl.DateTimeFormat('en', { timeZone: 'Zulu' }).resolvedOptions().timeZone);
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
for (let tz of [ false, [], {}, function () {}]) {
assertThrows(() => new Date().toLocaleString(undefined, { timeZone: tz }), RangeError);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment