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)
| 443 | // |
| 444 | // http://www.lua.org/manual/5.3/manual.html#lua_dump |
| 445 | func (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 | // |