Freeze integer types

This commit is contained in:
Rerumu 2022-05-18 19:44:38 -04:00
parent 30358c8205
commit 0366a74d0a

View File

@ -22,13 +22,15 @@ local math_log = math.log
local math_max = math.max local math_max = math.max
local math_pow = math.pow local math_pow = math.pow
local table_freeze = table.freeze
local from_u32, into_u32, from_u64, into_u64 local from_u32, into_u32, from_u64, into_u64
local num_add, num_subtract, num_multiply, num_divide_unsigned, num_negate local num_add, num_subtract, num_multiply, num_divide_unsigned, num_negate
local num_is_negative, num_is_zero, num_is_equal, num_is_less_unsigned, num_is_greater_unsigned local num_is_negative, num_is_zero, num_is_equal, num_is_less_unsigned, num_is_greater_unsigned
-- TODO: Eventually support Vector3 -- TODO: Eventually support Vector3
function Numeric.from_u32(data_1, data_2) function Numeric.from_u32(data_1, data_2)
return { data_1, data_2 } return table_freeze({ data_1, data_2 })
end end
function Numeric.into_u32(data) function Numeric.into_u32(data)
@ -405,4 +407,4 @@ K_BIT_SET_26 = from_u64(0x4000000)
Numeric.K_ZERO = K_ZERO Numeric.K_ZERO = K_ZERO
Numeric.K_ONE = K_ONE Numeric.K_ONE = K_ONE
return Numeric return table_freeze(Numeric)