LibJS: Fix sign data type in parse_temporal_time_zone_string()

A sign that's either the value 1 or -1 should obviously not have an
unsigned data type :^)

This would cause it to become 255 for the negative offset case, which
would then completely screw up the offset_nanoseconds calculation as it
serves as a multiplier.
This commit is contained in:
Linus Groh 2022-01-12 19:59:52 +01:00
parent 709fe64c1b
commit 323e1e17cf
Notes: sideshowbarker 2024-07-17 21:02:10 +09:00

View file

@ -1638,7 +1638,7 @@ ThrowCompletionOr<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject
// b. Set hours to ! ToIntegerOrInfinity(hours).
u8 hours = *hours_part->to_uint<u8>();
u8 sign;
i8 sign;
// c. If sign is the code unit 0x002D (HYPHEN-MINUS) or the code unit 0x2212 (MINUS SIGN), then
if (sign_part->is_one_of("-", "\u2212")) {
// i. Set sign to 1.