From bc43ee336b337284179d2dd82ed6e3e4649eed49 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Tue, 25 Jun 2024 01:44:27 +0200 Subject: [PATCH] Freeze the world inside export declaration --- lib/init.luau | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/init.luau b/lib/init.luau index 76e9e9e..54b642f 100644 --- a/lib/init.luau +++ b/lib/init.luau @@ -865,10 +865,6 @@ function World.__iter(world: World): WorldIterator return iterator :: any end --- freezing it incase somebody tries doing something stupid and modifying it --- (unlikely but its easy to add extra safety so) -table.freeze(World) - -- __nominal_type_dont_use could not be any or T as it causes a type error -- or produces a union export type Entity = number & { __nominal_type_dont_use: T } @@ -999,7 +995,7 @@ export type WorldShim = typeof(setmetatable( )) return table.freeze({ - World = (World :: any) :: { new: () -> WorldShim }, + World = (table.freeze(World) :: any) :: { new: () -> WorldShim }, OnAdd = (ON_ADD :: any) :: Entity, OnRemove = (ON_REMOVE :: any) :: Entity,