mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Usando noglobals.lua
This commit is contained in:
parent
5b911918e3
commit
b796207ce0
@ -1,17 +1,3 @@
|
|||||||
function mysetglobal (varname, oldvalue, newvalue)
|
|
||||||
print("changing " .. varname)
|
|
||||||
%rawset(%globals(), varname, newvalue)
|
|
||||||
end
|
|
||||||
function mygetglobal (varname, newvalue)
|
|
||||||
print("checking " .. varname)
|
|
||||||
return %rawget(%globals(), varname)
|
|
||||||
end
|
|
||||||
settagmethod(tag(nil), "setglobal", mysetglobal)
|
|
||||||
settagmethod(tag(nil), "getglobal", mygetglobal)
|
|
||||||
|
|
||||||
assert(dofile "../lua/code.lua")
|
|
||||||
assert(dofile "../lua/url.lua")
|
|
||||||
|
|
||||||
local check_build_url = function(parsed)
|
local check_build_url = function(parsed)
|
||||||
local built = URL.build_url(parsed)
|
local built = URL.build_url(parsed)
|
||||||
if built ~= parsed.url then
|
if built ~= parsed.url then
|
||||||
|
Loading…
Reference in New Issue
Block a user