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

Method Dump

lua.go:445–451  ·  view source on GitHub ↗

Dump dumps a function as a binary chunk. It receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped. http://www.lua.org/manual/5.3/manual.html#lua_dump

(w io.Writer)

Source from the content-addressed store, hash-verified

443//
444// http://www.lua.org/manual/5.3/manual.html#lua_dump
445func (l *State) Dump(w io.Writer) error {
446 l.checkElementCount(1)
447 if f, ok := l.stack[l.top-1].(*luaClosure); ok {
448 return l.dump(f.prototype, w)
449 }
450 panic("closure expected")
451}
452
453// NewState creates a new thread running in a new, independent state.
454//

Calls 2

checkElementCountMethod · 0.95
dumpMethod · 0.95