about summary refs log tree commit diff stats
path: root/test/readonly.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-07 10:09:27 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-07 10:09:27 -0800
commit1f3ed8210d45b035a8f76185587f97e147fc7402 (patch)
treeda907b4c8aef4e26e84d0ec4b7ab3a827cdb57ad /test/readonly.lua
parent2b7ffea31612c16ab16735f6806195ab471ae409 (diff)
downloadteliva-1f3ed8210d45b035a8f76185587f97e147fc7402.tar.gz
delete some Lua 5.1 things
These are likely to suffer bitrot.
Diffstat (limited to 'test/readonly.lua')
-rw-r--r--test/readonly.lua12
1 files changed, 0 insertions, 12 deletions
diff --git a/test/readonly.lua b/test/readonly.lua
deleted file mode 100644
index 85c0b4e..0000000
--- a/test/readonly.lua
+++ /dev/null
@@ -1,12 +0,0 @@
--- make global variables readonly
-
-local f=function (t,i) error("cannot redefine global variable `"..i.."'",2) end
-local g={}
-local G=getfenv()
-setmetatable(g,{__index=G,__newindex=f})
-setfenv(1,g)
-
--- an example
-rawset(g,"x",3)
-x=2
-y=1	-- cannot redefine `y'
/a> 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153