Commit 70cb7c28 authored by Francois Perrad's avatar Francois Perrad

refactor PR #27

parent 4a008149
......@@ -2,6 +2,7 @@ Revision history for lua-MessagePack
0.5.1
fix extra bytes detection (see PR #26)
allows ipairs(mp.packers) (see PR #27)
0.5.0 Fri Mar 10 17:07:20 2017
export unpack_cursor instead of unpackers (see issue #23)
......
......@@ -61,8 +61,8 @@ end
local packers = setmetatable({}, {
__index = function (t, k)
-- return nil for k == 1 to avoid breaking ipairs()
if k ~= 1 then error("pack '" .. k .. "' is unimplemented") end
if k == 1 then return end -- allows ipairs
error("pack '" .. k .. "' is unimplemented")
end
})
m.packers = packers
......
......@@ -44,8 +44,8 @@ end
local packers = setmetatable({}, {
__index = function (t, k)
-- return nil for k == 1 to avoid breaking ipairs()
if k ~= 1 then error("pack '" .. k .. "' is unimplemented") end
if k == 1 then return end -- allows ipairs
error("pack '" .. k .. "' is unimplemented")
end
})
m.packers = packers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment