Compile json.lua with luac from lua-5.3.1 , run the binary code but got the error :attempt to call a nil value (global 'module')
if we want to run binary code compiled with luac in lua-5.3.1 ,below way to build module will cause runtime error:
local base = _G
-- Module declaration
module("json")
the right way might be like this:
local moduleName = json
local M = {} -- 局部的变量
_G[moduleName] = M -- 将这个局部变量最终赋值给模块名
package.loaded[moduleName] = M
..........
@nirenr ,Could you please verify this error and fixed it .