diff options
author | Linus Groh <mail@linusgroh.de> | 2021-12-10 23:32:54 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-12-10 23:32:54 +0000 |
commit | aa2b85c697725147036b2805512d85db5ec1e6a8 (patch) | |
tree | 761761f260fdc5e017bc0106b9a974a2b516c18d /Userland/Libraries/LibJS/Runtime | |
parent | de00a7594f57f5c58bf117f9161c5fcff67df81d (diff) | |
download | serenity-aa2b85c697725147036b2805512d85db5ec1e6a8.zip |
LibJS: Use AK::NaN<double> in Date::date_value() to fix build error
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]
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Date.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 <AK/Math.h> #include <LibCore/DateTime.h> #include <LibJS/Runtime/Object.h> @@ -78,7 +79,7 @@ public: double date_value() const { return m_is_invalid - ? NAN + ? AK::NaN<double> : static_cast<double>(m_datetime.timestamp() * 1000 + m_milliseconds); } |