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

Function loLoaderPreload

loadlib.go:80–93  ·  view source on GitHub ↗
(L *LState)

Source from the content-addressed store, hash-verified

78}
79
80func loLoaderPreload(L *LState) int {
81 name := L.CheckString(1)
82 preload := L.GetField(L.GetField(L.Get(EnvironIndex), "package"), "preload")
83 if _, ok := preload.(*LTable); !ok {
84 L.RaiseError("package.preload must be a table")
85 }
86 lv := L.GetField(preload, name)
87 if lv == LNil {
88 L.Push(LString(fmt.Sprintf("no field package.preload['%s']", name)))
89 return 1
90 }
91 L.Push(lv)
92 return 1
93}
94
95func loLoaderLua(L *LState) int {
96 name := L.CheckString(1)

Callers

nothing calls this directly

Calls 6

LStringTypeAlias · 0.85
CheckStringMethod · 0.80
PushMethod · 0.65
GetFieldMethod · 0.45
GetMethod · 0.45
RaiseErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…