Merge pull request #51 from qaisjp/patch-1

Fix return of super.static if val false (fix #50)
This commit is contained in:
Enrique García Cota 2017-12-06 12:55:05 +01:00 committed by GitHub
commit f9955f9285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,15 @@ local function _createClass(name, super)
subclasses = setmetatable({}, {__mode='k'}) }
if super then
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) or super.static[k] end })
setmetatable(aClass.static, {
__index = function(_,k)
local result = rawget(dict,k)
if result == nil then
return super.static[k]
end
return result
end
})
else
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end })
end