data_buffer: constructor fix
This commit is contained in:
parent
541fce0751
commit
c3027368b6
@ -22,10 +22,24 @@ local TYPE_DOUBLE = 6
|
|||||||
|
|
||||||
-- Data buffer
|
-- Data buffer
|
||||||
|
|
||||||
local data_buffer = { }
|
local data_buffer =
|
||||||
|
{
|
||||||
|
__call =
|
||||||
|
function(data_buffer, bytes)
|
||||||
|
return data_buffer:new(bytes)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
function data_buffer.__call(bytes)
|
function data_buffer:new(bytes)
|
||||||
return setmetatable({ pos = 1, bytes = bytes or { } }, { __index = data_buffer })
|
local obj = {
|
||||||
|
pos = 1,
|
||||||
|
bytes = bytes or { }
|
||||||
|
}
|
||||||
|
|
||||||
|
self.__index = self
|
||||||
|
setmetatable(obj, self)
|
||||||
|
print("asg")
|
||||||
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Push functions
|
-- Push functions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user