From 0366a74d0afa4f44ef56ab15e10c17685d42a553 Mon Sep 17 00:00:00 2001 From: Rerumu Date: Wed, 18 May 2022 19:44:38 -0400 Subject: [PATCH] Freeze integer types --- codegen-luau/runtime/numeric.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codegen-luau/runtime/numeric.lua b/codegen-luau/runtime/numeric.lua index 13b35d9..6add68e 100644 --- a/codegen-luau/runtime/numeric.lua +++ b/codegen-luau/runtime/numeric.lua @@ -22,13 +22,15 @@ local math_log = math.log local math_max = math.max local math_pow = math.pow +local table_freeze = table.freeze + local from_u32, into_u32, from_u64, into_u64 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 -- TODO: Eventually support Vector3 function Numeric.from_u32(data_1, data_2) - return { data_1, data_2 } + return table_freeze({ data_1, data_2 }) end function Numeric.into_u32(data) @@ -405,4 +407,4 @@ K_BIT_SET_26 = from_u64(0x4000000) Numeric.K_ZERO = K_ZERO Numeric.K_ONE = K_ONE -return Numeric +return table_freeze(Numeric)