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

Function NewStateEx

auxiliary.go:536–546  ·  view source on GitHub ↗

NewStateEx creates a new Lua state. It calls NewState and then sets a panic function that prints an error message to the standard error output in case of fatal errors. Returns the new state.

()

Source from the content-addressed store, hash-verified

534//
535// Returns the new state.
536func NewStateEx() *State {
537 l := NewState()
538 if l != nil {
539 _ = AtPanic(l, func(l *State) int {
540 s, _ := l.ToString(-1)
541 fmt.Fprintf(os.Stderr, "PANIC: unprotected error in call to Lua API (%s)\n", s)
542 return 0
543 })
544 }
545 return l
546}
547
548func LengthEx(l *State, index int) int {
549 l.Length(index)

Callers

nothing calls this directly

Calls 3

ToStringMethod · 0.95
NewStateFunction · 0.85
AtPanicFunction · 0.85

Tested by

no test coverage detected