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:
parent
709fe64c1b
commit
323e1e17cf
Notes:
sideshowbarker
2024-07-17 21:02:10 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/323e1e17cf3 Pull-request: https://github.com/SerenityOS/serenity/pull/11840 Reviewed-by: https://github.com/IdanHo
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue