summaryrefslogtreecommitdiff
path: root/lua.go
diff options
context:
space:
mode:
Diffstat (limited to 'lua.go')
-rw-r--r--lua.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua.go b/lua.go
index b6d7027..11eec3e 100644
--- a/lua.go
+++ b/lua.go
@@ -293,12 +293,14 @@ func (l *Lua) GetGlobal(name string) {
}
func (l *Lua) NewThread(yield func(), resume func() bool) *Lua {
- return &Lua{
+ newl := &Lua{
l: C.lua_newthread(l.l),
running: l.running,
resume: resume,
yield: yield,
}
+ newl.PushGoFunction(TracebackHandler)
+ return newl
}
// TracebackHandler handles stack trace formatting on errors.