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

Method undump

undump.go:306–323  ·  view source on GitHub ↗
(in io.Reader, name string)

Source from the content-addressed store, hash-verified

304}
305
306func (l *State) undump(in io.Reader, name string) (c *luaClosure, err error) {
307 if name[0] == '@' || name[0] == '=' {
308 name = name[1:]
309 } else if name[0] == Signature[0] {
310 name = "binary string"
311 }
312 // TODO assign name to p.source?
313 s := &loadState{in, endianness()}
314 var p prototype
315 if err = s.checkHeader(); err != nil {
316 return
317 } else if p, err = s.readFunction(); err != nil {
318 return
319 }
320 c = l.newLuaClosure(&p)
321 l.push(c)
322 return
323}

Callers 5

TestUndumpFunction · 0.95
expectErrorFromUndumpFunction · 0.95
protectedParserFunction · 0.80

Calls 5

newLuaClosureMethod · 0.95
pushMethod · 0.95
endiannessFunction · 0.85
checkHeaderMethod · 0.80
readFunctionMethod · 0.80

Tested by 4

TestUndumpFunction · 0.76
expectErrorFromUndumpFunction · 0.76