Module:IP: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
prevent altering of isSubnetObject by using __metatable with a unique key
(use getmetatable to implement isSubnetObject)
(prevent altering of isSubnetObject by using __metatable with a unique key)
Line 496:
 
do
local uniqueKey = {}
 
-- Metatable
local mt = {
Line 504 ⟶ 506:
return self:getCIDR()
end,
__metatable = uniqueKey
}
 
-- Private static methods
local function isSubnetObject(val)
return getmetatable(val) == mtuniqueKey
end
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu