Skip to content

Commit

Permalink
漏掉的文件
Browse files Browse the repository at this point in the history
  • Loading branch information
jarjin committed Mar 8, 2016
1 parent d7728a0 commit 5492ac5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Assets/LuaFramework/ToLua/Lua/system/slot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--------------------------------------------------------------------------------
-- Copyright (c) 2015 , 蒙占志(topameng) topameng@gmail.com
-- All rights reserved.
-- Use, modification and distribution are subject to the "MIT License"
--------------------------------------------------------------------------------
local setmetatable = setmetatable

local _slot = {}
setmetatable(_slot, _slot)

_slot.__call = function(self, ...)
if nil == self.obj then
return self.func(...)
else
return self.func(self.obj, ...)
end
end

_slot.__eq = function (lhs, rhs)
return lhs.func == rhs.func and lhs.obj == rhs.obj
end

function slot(func, obj)
local st = {func = func, obj = obj}
setmetatable(st, _slot)
return st
end
4 changes: 4 additions & 0 deletions Assets/LuaFramework/ToLua/Lua/system/slot.lua.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Assets/LuaFramework/ToLua/Lua/system/typeof.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local types = {}
local _typeof = tolua.typeof


function typeof(obj)
local t = type(obj)
local ret = nil

if t == "table" then
ret = types[obj]

if ret == nil then
ret = _typeof(obj)
types[obj] = ret
end
end

return ret
end
4 changes: 4 additions & 0 deletions Assets/LuaFramework/ToLua/Lua/system/typeof.lua.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5492ac5

Please sign in to comment.