mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibJS: Make Value::as_u32() slightly less broken
Still a horrible mess, but at least it can actually return numbers > i32 max now.
This commit is contained in:
parent
30fe0529bd
commit
47bd25a2f1
Notes:
sideshowbarker
2024-07-18 10:17:11 +09:00
Author: https://github.com/linusg
Commit: 47bd25a2f1
Pull-request: https://github.com/SerenityOS/serenity/pull/8499
Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 1 additions and 1 deletions
|
@ -584,7 +584,7 @@ i32 Value::as_i32() const
|
|||
u32 Value::as_u32() const
|
||||
{
|
||||
VERIFY(as_double() >= 0);
|
||||
return min((u32)as_i32(), NumericLimits<u32>::max());
|
||||
return (u32)min(as_double(), (double)NumericLimits<u32>::max());
|
||||
}
|
||||
|
||||
double Value::to_double(GlobalObject& global_object) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue