File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ local char = string.char
5454local gsub = string.gsub
5555local fmt = string.format
5656
57+ local _rawget
58+ if rawget then
59+ _rawget = rawget
60+ else
61+ _rawget = function (t , k ) return t [k ] end
62+ end
63+
5764local function rawpairs (t )
5865 return next , t , nil
5966end
149156local function getKeys (t )
150157
151158 local seqLen = 1
152- while rawget (t , seqLen ) ~= nil do
159+ while _rawget (t , seqLen ) ~= nil do
153160 seqLen = seqLen + 1
154161 end
155162 seqLen = seqLen - 1
Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ local char = string.char
5454local gsub = string.gsub
5555local fmt = string.format
5656
57+ local _rawget: function (table , any ): any
58+ if rawget then
59+ _rawget = rawget
60+ else
61+ _rawget = function (t: table , k: any ): any return t[k] end
62+ end
63+
5764local function rawpairs (t: table ): function , table , nil
5865 return next, t, nil
5966end
149156local function getKeys (t: table ): {any } , integer , integer
150157 -- seqLen counts the "array-like" keys
151158 local seqLen: integer = 1
152- while rawget (t, seqLen) ~= nil do
159+ while _rawget (t, seqLen) ~= nil do
153160 seqLen = seqLen + 1
154161 end
155162 seqLen = seqLen - 1
You can’t perform that action at this time.
0 commit comments