xroom added for lazy peoples ;)

This commit is contained in:
p.kosyh 2010-06-29 13:18:03 +00:00
parent e76fda3658
commit c356322a3c

View file

@ -107,3 +107,18 @@ function xdsc(n)
end
return obj(v)
end
default_xdsc_obj = xdsc();
xroom = stead.hook(room, function(f, v, ...)
if type(v) == 'table' then
if v.obj == nil then
v.obj = {}
elseif type(v.obj) ~= 'table' then
error("Wrong parameter to xroom.", 2);
end
-- we not use put here, to force saver do not save all list
stead.table.insert(v.obj, 1, 'default_xdsc_obj');
end
return f(v, unpack(arg))
end)