new metamethod __len,__pairs,__ipairs in lua 5.2

This commit is contained in:
kenshin 2013-12-02 11:48:20 +08:00
parent f10637b23b
commit 151c5b2c71

View File

@ -97,7 +97,8 @@ end
local Object = _createClass("Object", nil)
Object.static.__metamethods = { '__add', '__call', '__concat', '__div', '__le', '__lt',
'__mod', '__mul', '__pow', '__sub', '__tostring', '__unm' }
'__mod', '__mul', '__pow', '__sub', '__tostring', '__unm',
'__len','__pairs','__ipairs'}
function Object.static:allocate()
assert(type(self) == 'table', "Make sure that you are using 'Class:allocate' instead of 'Class.allocate'")