mirror of
https://codeberg.org/1414codeforge/gear.git
synced 2025-04-14 02:12:12 +02:00
[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…
x
Reference in New Issue
Block a user