无编辑摘要
Cquote>Liangent 无编辑摘要 |
Cquote>Liangent 无编辑摘要 |
||
| 第2行: | 第2行: | ||
function mt.__index (t, k) | function mt.__index (t, k) | ||
if k ~= 'arg' then | if k ~= 'arg' then | ||
error(' | error('读取该非全局变量出错:' .. tostring(k), 2) | ||
end | end | ||
return nil | return nil | ||
| 第8行: | 第8行: | ||
function mt.__newindex(t, k, v) | function mt.__newindex(t, k, v) | ||
if k ~= 'arg' then | if k ~= 'arg' then | ||
error(' | error('写入该全局变量出错:' .. tostring(k), 2) | ||
end | end | ||
rawset(t, k, v) | rawset(t, k, v) | ||
end | end | ||
setmetatable(_G, mt) | setmetatable(_G, mt) | ||