summaryrefslogtreecommitdiff
path: root/luajit.go
diff options
context:
space:
mode:
Diffstat (limited to 'luajit.go')
-rw-r--r--luajit.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/luajit.go b/luajit.go
index 2ed3788..0b1fb55 100644
--- a/luajit.go
+++ b/luajit.go
@@ -290,12 +290,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.