added tinker_core as lib
This commit is contained in:
22
src/polyfill.lua
Normal file
22
src/polyfill.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Polyfill require function
|
||||
_G.require = function (module)
|
||||
-- Polyfill luv package
|
||||
if module == "luv" then
|
||||
local module = {}
|
||||
local metatable = {
|
||||
__index = function(t, i)
|
||||
-- Polyfill gettimeofday
|
||||
if i == "gettimeofday" then
|
||||
return function ()
|
||||
local mil = os.epoch()
|
||||
return mil / 1000, mil
|
||||
end
|
||||
else
|
||||
print("ERROR: Tell a dev to implement: " .. i)
|
||||
end
|
||||
end
|
||||
}
|
||||
setmetatable(module, metatable)
|
||||
return module
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user