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)