Currently, yaegi only records source positions when writing panic trace to stderr. This change adds function names to the panic output. Unfortunately, yaegi walks the trace in reverse order, comparing to Go runtime. This can be improved in the future.
21 lines
135 B
Go
21 lines
135 B
Go
package main
|
|
|
|
func main() {
|
|
foo()
|
|
}
|
|
|
|
func foo() {
|
|
bar()
|
|
}
|
|
|
|
func bar() {
|
|
baz()
|
|
}
|
|
|
|
func baz() {
|
|
panic("stop!")
|
|
}
|
|
|
|
// Error:
|
|
// stop!
|