UPDATE This was removed/disabled a while back in build 2876
http://developer.coronalabs.com/release/2016/2876/
Here is a alternative solution fix:
--=================================================== --= Niklas Frykholm -- basically if user tries to create global variable -- the system will not let them!! -- call GLOBAL\_lock(\_G) -- --=================================================== function GLOBAL\_lock(t) local mt = getmetatable(t) or {} mt.\_\_newindex = lock\_new\_index setmetatable(t, mt) end --=================================================== -- call GLOBAL\_unlock(\_G) -- to change things back to normal. --=================================================== function GLOBAL\_unlock(t) local mt = getmetatable(t) or {} mt.\_\_newindex = unlock\_new\_index setmetatable(t, mt) end function lock\_new\_index(t, k, v) if (k~="\_" and string.sub(k,1,2) ~= "\_\_") then GLOBAL\_unlock(\_G) error("GLOBALS are locked -- " .. k .. " must be declared local or prefix with '\_\_' for globals.", 2) else rawset(t, k, v) end end function unlock\_new\_index(t, k, v) rawset(t, k, v) end local public = {} public.lock = GLOBAL\_lock public.unlock = GLOBAL\_unlock return public
local gl = require "global\_lock" gl.lock(\_G) \_G.bob = true
Note: Be sure not to lock until AFTER initializing SSK2.
require "ssk2.loadSSK" \_G.ssk.init() \_G.ssk.init( { launchArgs = ..., enableAutoListeners = true, exportCore = true, exportColors = true, exportSystem = true, exportSystem = true, gameFont = "Prime.ttf", debugLevel = 0 } ) local gl = require "global\_lock" gl.lock(\_G)