prosody

changeset 3024
9c74785c6351
parent 3023
454e1cf18daf
child 3029
0c7beabfed5b
child 3304
fec74b84df61
equal deleted inserted replaced
3023:454e1cf18daf 3024:9c74785c6351
140 name = debug.getupvalue(f, i); 140 name = debug.getupvalue(f, i);
141 until name == upvalue or name == nil; 141 until name == upvalue or name == nil;
142 if name then 142 if name then
143 debug.setupvalue(f, i, value); 143 debug.setupvalue(f, i, value);
144 end 144 end
145 end
146 function mt.__tostring(f)
147 local info = debug.getinfo(f);
148 return ("function(%s:%d)"):format(info.short_src:match("[^\\/]*$"), info.linedefined);
145 end 149 end
146 debug.setmetatable(function() end, mt); 150 debug.setmetatable(function() end, mt);
147 end 151 end
148 152
149 function init_global_state() 153 function init_global_state()

mercurial