* basic functions {{{ */
(L *LState)
| 12 | /* basic functions {{{ */ |
| 13 | |
| 14 | func OpenBase(L *LState) int { |
| 15 | global := L.Get(GlobalsIndex).(*LTable) |
| 16 | L.SetGlobal("_G", global) |
| 17 | L.SetGlobal("_VERSION", LString(LuaVersion)) |
| 18 | L.SetGlobal("_GOPHER_LUA_VERSION", LString(PackageName+" "+PackageVersion)) |
| 19 | basemod := L.RegisterModule("_G", baseFuncs) |
| 20 | global.RawSetString("ipairs", L.NewClosure(baseIpairs, L.NewFunction(ipairsaux))) |
| 21 | global.RawSetString("pairs", L.NewClosure(basePairs, L.NewFunction(pairsaux))) |
| 22 | L.Push(basemod) |
| 23 | return 1 |
| 24 | } |
| 25 | |
| 26 | var baseFuncs = map[string]LGFunction{ |
| 27 | "assert": baseAssert, |
nothing calls this directly
no test coverage detected
searching dependent graphs…