mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +00:00
Changed init to initialize
Fixed bug on subclassOf
This commit is contained in:
parent
78afebdf79
commit
fe77227db0
@ -85,7 +85,7 @@ setmetatable(Object, { __index = Object.__classDict, __newindex = Object.__class
|
|||||||
-- Returns true if class is a subclass of other, false otherwise
|
-- Returns true if class is a subclass of other, false otherwise
|
||||||
function subclassOf(other, class)
|
function subclassOf(other, class)
|
||||||
if class.superclass==nil then return false end --class is Object, or a non-class
|
if class.superclass==nil then return false end --class is Object, or a non-class
|
||||||
return class.superclass == other or class.superclass:subclassOf(other)
|
return class.superclass == other or subclassOf(other, class.superclass)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns true if obj is an instance of class (or one of its subclasses) false otherwise
|
-- Returns true if obj is an instance of class (or one of its subclasses) false otherwise
|
||||||
|
Loading…
Reference in New Issue
Block a user