webmcp

diff libraries/atom/atom.lua @ 64:3d43a5cf17c1

Compatibility with Lua 5.2
author jbe
date Sun Apr 15 16:04:33 2012 +0200 (2012-04-15)
parents 985024b16520
children 24ed2cd053aa
line diff
     1.1 --- a/libraries/atom/atom.lua	Tue Apr 03 00:56:02 2012 +0200
     1.2 +++ b/libraries/atom/atom.lua	Sun Apr 15 16:04:33 2012 +0200
     1.3 @@ -4,33 +4,32 @@
     1.4  local _VERSION       = _VERSION
     1.5  local assert         = assert
     1.6  local error          = error
     1.7 -local getfenv        = getfenv
     1.8  local getmetatable   = getmetatable
     1.9  local ipairs         = ipairs
    1.10 -local module         = module
    1.11  local next           = next
    1.12  local pairs          = pairs
    1.13  local print          = print
    1.14  local rawequal       = rawequal
    1.15  local rawget         = rawget
    1.16 +local rawlen         = rawlen
    1.17  local rawset         = rawset
    1.18 -local require        = require
    1.19  local select         = select
    1.20 -local setfenv        = setfenv
    1.21  local setmetatable   = setmetatable
    1.22  local tonumber       = tonumber
    1.23  local tostring       = tostring
    1.24  local type           = type
    1.25 -local unpack         = unpack
    1.26  
    1.27 -local coroutine = coroutine
    1.28 -local io        = io
    1.29  local math      = math
    1.30 -local os        = os
    1.31  local string    = string
    1.32  local table     = table
    1.33  
    1.34 -module(...)
    1.35 +local _M = {}
    1.36 +if _ENV then
    1.37 +  _ENV = _M
    1.38 +else
    1.39 +  _G[...] = _M
    1.40 +  setfenv(1, _M)
    1.41 +end
    1.42  
    1.43  
    1.44  
    1.45 @@ -1537,3 +1536,6 @@
    1.46    end
    1.47  end
    1.48  
    1.49 +
    1.50 +
    1.51 +return _M

Impressum / About Us