Ir al contenido

Diferencia entre revisiones de «Módulo:No globals»

7 bytes añadidos ,  29 ene 2023
m
Protegió «Módulo:No globals» ([Editar=Solo bibliotecarios] (indefinido) [Trasladar=Solo bibliotecarios] (indefinido))
m (1 revisión importada)
wikitves>LuchoCR
m (Protegió «Módulo:No globals» ([Editar=Solo bibliotecarios] (indefinido) [Trasladar=Solo bibliotecarios] (indefinido)))
Línea 2: Línea 2:
function mt.__index (t, k)
function mt.__index (t, k)
if k ~= 'arg' then
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
error('Trató de leer nil global ' .. tostring(k), 2)
end
end
return nil
return nil
Línea 8: Línea 8:
function mt.__newindex(t, k, v)
function mt.__newindex(t, k, v)
if k ~= 'arg' then
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
--error('Trató de escribir global ' .. tostring(k), 2)
end
end
rawset(t, k, v)
rawset(t, k, v)
end
end
setmetatable(_G, mt)
setmetatable(_G, mt)
Usuario anónimo