From aa2b85c697725147036b2805512d85db5ec1e6a8 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 10 Dec 2021 23:32:54 +0000 Subject: LibJS: Use AK::NaN in Date::date_value() to fix build error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was not happening locally for me, neither when building Lagom on Linux nor with the SerenityOS toolchain... error: implicit conversion from ‘float’ to ‘double’ to match other result of conditional [-Werror=double-promotion] --- Userland/Libraries/LibJS/Runtime/Date.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland/Libraries/LibJS/Runtime') diff --git a/Userland/Libraries/LibJS/Runtime/Date.h b/Userland/Libraries/LibJS/Runtime/Date.h index 1b91d022ae..33a6502ae9 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.h +++ b/Userland/Libraries/LibJS/Runtime/Date.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include @@ -78,7 +79,7 @@ public: double date_value() const { return m_is_invalid - ? NAN + ? AK::NaN : static_cast(m_datetime.timestamp() * 1000 + m_milliseconds); } -- cgit v1.2.3