1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:47:45 +00:00

LibJS: Export MAX_ARRAY_LIKE_INDEX & NEGATIVE_ZERO_BITS in JS namespace

This commit is contained in:
Shannon Booth 2023-12-27 20:59:53 +13:00 committed by Andreas Kling
parent f86ec46a6e
commit 56ec36a9dc

View file

@ -21,13 +21,13 @@
#include <LibJS/Heap/GCPtr.h> #include <LibJS/Heap/GCPtr.h>
#include <math.h> #include <math.h>
namespace JS {
// 2 ** 53 - 1 // 2 ** 53 - 1
static constexpr double MAX_ARRAY_LIKE_INDEX = 9007199254740991.0; static constexpr double MAX_ARRAY_LIKE_INDEX = 9007199254740991.0;
// Unique bit representation of negative zero (only sign bit set) // Unique bit representation of negative zero (only sign bit set)
static constexpr u64 NEGATIVE_ZERO_BITS = ((u64)1 << 63); static constexpr u64 NEGATIVE_ZERO_BITS = ((u64)1 << 63);
namespace JS {
static_assert(sizeof(double) == 8); static_assert(sizeof(double) == 8);
static_assert(sizeof(void*) == sizeof(double) || sizeof(void*) == sizeof(u32)); static_assert(sizeof(void*) == sizeof(double) || sizeof(void*) == sizeof(u32));
// To make our Value representation compact we can use the fact that IEEE // To make our Value representation compact we can use the fact that IEEE