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

Method PreloadModule

auxlib.go:432–438  ·  view source on GitHub ↗

Set a module loader to the package.preload table.

(name string, loader LGFunction)

Source from the content-addressed store, hash-verified

430
431// Set a module loader to the package.preload table.
432func (ls *LState) PreloadModule(name string, loader LGFunction) {
433 preload := ls.GetField(ls.GetField(ls.Get(EnvironIndex), "package"), "preload")
434 if _, ok := preload.(*LTable); !ok {
435 ls.RaiseError("package.preload must be a table")
436 }
437 ls.SetField(preload, name, ls.NewFunction(loader))
438}
439
440// Checks whether the given index is an LChannel and returns this channel.
441func (ls *LState) CheckChannel(n int) chan LValue {

Callers

nothing calls this directly

Calls 5

GetFieldMethod · 0.95
GetMethod · 0.95
RaiseErrorMethod · 0.95
SetFieldMethod · 0.95
NewFunctionMethod · 0.95

Tested by

no test coverage detected