MCPcopy Index your code
hub / github.com/yuin/gopher-lua / OpenLibs

Method OpenLibs

linit.go:46–54  ·  view source on GitHub ↗

OpenLibs loads the built-in libraries. It is equivalent to running OpenLoad, then OpenBase, then iterating over the other OpenXXX functions in any order.

()

Source from the content-addressed store, hash-verified

44// OpenLibs loads the built-in libraries. It is equivalent to running OpenLoad,
45// then OpenBase, then iterating over the other OpenXXX functions in any order.
46func (ls *LState) OpenLibs() {
47 // NB: Map iteration order in Go is deliberately randomised, so must open Load/Base
48 // prior to iterating.
49 for _, lib := range luaLibs {
50 ls.Push(ls.NewFunction(lib.libFunc))
51 ls.Push(LString(lib.libName))
52 ls.Call(1, 0)
53 }
54}

Callers 2

NewStateFunction · 0.95
NewStateFunction · 0.95

Calls 4

PushMethod · 0.95
NewFunctionMethod · 0.95
CallMethod · 0.95
LStringTypeAlias · 0.85

Tested by

no test coverage detected