mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Make Token use the new double parser
This commit is contained in:
parent
9921f80817
commit
7db59124e8
Notes:
sideshowbarker
2024-07-17 05:11:53 +09:00
Author: https://github.com/davidot Commit: https://github.com/SerenityOS/serenity/commit/7db59124e8 Pull-request: https://github.com/SerenityOS/serenity/pull/15377 Issue: https://github.com/SerenityOS/serenity/issues/14691 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/linusg
1 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
#include "Token.h"
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/CharacterTypes.h>
|
||||
#include <AK/FloatingPointStringConversions.h>
|
||||
#include <AK/GenericLexer.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
|
||||
|
@ -79,7 +80,8 @@ double Token::double_value() const
|
|||
return static_cast<double>(strtoul(value_string.characters() + 1, nullptr, 8));
|
||||
}
|
||||
}
|
||||
return strtod(value_string.characters(), nullptr);
|
||||
// This should always be a valid double
|
||||
return value_string.to_double().release_value();
|
||||
}
|
||||
|
||||
static u32 hex2int(char x)
|
||||
|
|
Loading…
Reference in a new issue