[meta] Use rawequal() to compare tables in isinstance().
Ensures no fancy metamethod is invoked during testing.
This commit is contained in:
parent
ac68fce474
commit
75d60b98f5
2
meta.lua
2
meta.lua
|
@ -15,7 +15,7 @@ local meta = {}
|
||||||
function meta.isinstance(obj, cls)
|
function meta.isinstance(obj, cls)
|
||||||
repeat
|
repeat
|
||||||
local m = getmetatable(obj)
|
local m = getmetatable(obj)
|
||||||
if m == cls then return true end
|
if rawequal(m, cls) then return true end
|
||||||
|
|
||||||
obj = m
|
obj = m
|
||||||
until obj == nil
|
until obj == nil
|
||||||
|
|
Loading…
Reference in New Issue