From f01a007c913862fdd4ed9c396eef35085f7b048d Mon Sep 17 00:00:00 2001 From: kikito Date: Sat, 21 Nov 2015 17:08:09 +0100 Subject: [PATCH] attempts to fix failing travis --- inspect.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inspect.lua b/inspect.lua index b7107d4..61a9ec2 100644 --- a/inspect.lua +++ b/inspect.lua @@ -31,6 +31,9 @@ local inspect ={ inspect.KEY = setmetatable({}, {__tostring = function() return 'inspect.KEY' end}) inspect.METATABLE = setmetatable({}, {__tostring = function() return 'inspect.METATABLE' end}) +-- returns the length of a table, ignoring __len (if it exists) +local rawlen = _G.rawlen or function(t) return #t end + -- Apostrophizes the string if it has quotes, but not aphostrophes -- Otherwise, it returns a regular quoted string local function smartQuote(str) @@ -84,7 +87,7 @@ local function sortKeys(a, b) end local function getNonSequentialKeys(t) - local keys, length = {}, #t + local keys, length = {}, rawlen(t) for k,_ in pairs(t) do if not isSequenceKey(k, length) then table.insert(keys, k) end end