[meta] Use rawequal() to compare tables in isinstance().

Ensures no fancy metamethod is invoked during testing.
This commit is contained in:
Lorenzo Cogotti 2022-09-10 09:41:44 +02:00
parent ac68fce474
commit 75d60b98f5
1 changed files with 1 additions and 1 deletions

View File

@ -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