mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +00:00
made Object non-global
This commit is contained in:
parent
88e84d13c2
commit
cd9609e1ae
@ -94,7 +94,7 @@ local function _includeMixin(klass, mixin)
|
||||
klass.__mixins[mixin] = true
|
||||
end
|
||||
|
||||
Object = _createClass("Object", nil)
|
||||
local Object = _createClass("Object", nil)
|
||||
|
||||
Object.static.__metamethods = { '__add', '__call', '__concat', '__div', '__le', '__lt',
|
||||
'__mod', '__mul', '__pow', '__sub', '__tostring', '__unm' }
|
||||
@ -157,6 +157,8 @@ function middleclass.class(name, super, ...)
|
||||
return super:subclass(name, ...)
|
||||
end
|
||||
|
||||
middleclass.Object = Object
|
||||
|
||||
setmetatable(middleclass, { __call = function(_, ...) return middleclass.class(...) end })
|
||||
|
||||
return middleclass
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('Object', function()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('class()', function()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('includes', function()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('instanceOf', function()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('Metamethods', function()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
local class = require 'middleclass'
|
||||
local Object = class.Object
|
||||
|
||||
context('subclassOf', function()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user