MCPcopy Index your code
hub / github.com/Shopify/go-lua / StringOpen

Function StringOpen

string.go:237–248  ·  view source on GitHub ↗

StringOpen opens the string library. Usually passed to Require.

(l *State)

Source from the content-addressed store, hash-verified

235
236// StringOpen opens the string library. Usually passed to Require.
237func StringOpen(l *State) int {
238 NewLibrary(l, stringLibrary)
239 l.CreateTable(0, 1)
240 l.PushString("")
241 l.PushValue(-2)
242 l.SetMetaTable(-2)
243 l.Pop(1)
244 l.PushValue(-2)
245 l.SetField(-2, "__index")
246 l.Pop(1)
247 return 1
248}

Callers

nothing calls this directly

Calls 7

NewLibraryFunction · 0.85
CreateTableMethod · 0.80
PushStringMethod · 0.80
PushValueMethod · 0.80
SetMetaTableMethod · 0.80
PopMethod · 0.80
SetFieldMethod · 0.80

Tested by

no test coverage detected