webmcp
diff libraries/mondelefant/mondelefant.lua @ 64:3d43a5cf17c1
Compatibility with Lua 5.2
author | jbe |
---|---|
date | Sun Apr 15 16:04:33 2012 +0200 (2012-04-15) |
parents | 594a85118cb7 |
children | 937bbe05098c |
line diff
1.1 --- a/libraries/mondelefant/mondelefant.lua Tue Apr 03 00:56:02 2012 +0200 1.2 +++ b/libraries/mondelefant/mondelefant.lua Sun Apr 15 16:04:33 2012 +0200 1.3 @@ -8,42 +8,35 @@ 1.4 local _G = _G 1.5 local _VERSION = _VERSION 1.6 local assert = assert 1.7 -local collectgarbage = collectgarbage 1.8 -local dofile = dofile 1.9 local error = error 1.10 -local getfenv = getfenv 1.11 local getmetatable = getmetatable 1.12 local ipairs = ipairs 1.13 -local load = load 1.14 -local loadfile = loadfile 1.15 -local loadstring = loadstring 1.16 local next = next 1.17 local pairs = pairs 1.18 -local pcall = pcall 1.19 local print = print 1.20 local rawequal = rawequal 1.21 local rawget = rawget 1.22 +local rawlen = rawlen 1.23 local rawset = rawset 1.24 local select = select 1.25 -local setfenv = setfenv 1.26 local setmetatable = setmetatable 1.27 local tonumber = tonumber 1.28 local tostring = tostring 1.29 local type = type 1.30 -local unpack = unpack 1.31 -local xpcall = xpcall 1.32 1.33 -local coroutine = coroutine 1.34 -local io = io 1.35 local math = math 1.36 -local os = os 1.37 local string = string 1.38 local table = table 1.39 1.40 local add = table.insert 1.41 1.42 -_G[...] = require("mondelefant_native") 1.43 -module(...) 1.44 +local _M = require("mondelefant_native") 1.45 +if _ENV then 1.46 + _ENV = _M 1.47 +else 1.48 + _G[...] = _M 1.49 + setfenv(1, _M) 1.50 +end 1.51 1.52 1.53