decoder: fixes 5.2-strict mode state object
[luajson.git] / tests / hook_require.lua
blob4853c3876fcaccb852d602539e8e24e6dcd253a5
1 local os = require("os")
2 local old_require = require
3 if os.getenv('LUA_OLD_INIT') then
4 assert(loadstring(os.getenv('LUA_OLD_INIT')))()
5 else
6 require("luarocks.require")
7 end
8 local luarocks_require = require
10 function require(module, ...)
11 if module == "json" or module:match("^json%.") then
12 return old_require(module, ...)
13 end
14 return luarocks_require(module, ...)
15 end