Commit: 0b0e49e7422f23774eb4380498ff08417179464a
Parent: ae769ec0c06225698574da557232d9ee81473c61
Author: Michael Forney
Date: Sat, 11 Apr 2026 15:51:27 -0700
Prevent accidental use of undefined globals
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/setup.lua b/setup.lua
@@ -1,5 +1,8 @@
#!/bin/lua
+-- prevent accidental use of undefined globals
+setmetatable(_G, {__index=function(_, var) error('undefined global \''..var..'\'') end})
+
-- Lua 5.1 compatibility
do
local os_execute = os.execute