commit 96acf7f
Michael Forney
·
2026-04-11 22:51:27 +0000 UTC
parent 6912561
Prevent accidental use of undefined globals
1 files changed,
+3,
-0
+3,
-0
1@@ -1,5 +1,8 @@
2 #!/bin/lua
3
4+-- prevent accidental use of undefined globals
5+setmetatable(_G, {__index=function(_, var) error('undefined global \''..var..'\'') end})
6+
7 -- Lua 5.1 compatibility
8 do
9 local os_execute = os.execute