From 7db59124e846097368097a5bac141fa36dff335d Mon Sep 17 00:00:00 2001 From: davidot Date: Wed, 12 Oct 2022 02:23:00 +0200 Subject: [PATCH] LibJS: Make Token use the new double parser --- Userland/Libraries/LibJS/Token.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp index 496761937f..4e5e8daf1f 100644 --- a/Userland/Libraries/LibJS/Token.cpp +++ b/Userland/Libraries/LibJS/Token.cpp @@ -8,6 +8,7 @@ #include "Token.h" #include #include +#include #include #include @@ -79,7 +80,8 @@ double Token::double_value() const return static_cast(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)