(b *bytes.Buffer)
| 271 | } |
| 272 | |
| 273 | func (f *StackFrame) Write(b *bytes.Buffer) { |
| 274 | if f.prg != nil { |
| 275 | if n := f.prg.funcName; n != "" { |
| 276 | b.WriteString(n.String()) |
| 277 | b.WriteString(" (") |
| 278 | } |
| 279 | p := f.Position() |
| 280 | if p.Filename != "" { |
| 281 | b.WriteString(p.Filename) |
| 282 | } else { |
| 283 | b.WriteString("<eval>") |
| 284 | } |
| 285 | b.WriteByte(':') |
| 286 | b.WriteString(strconv.Itoa(p.Line)) |
| 287 | b.WriteByte(':') |
| 288 | b.WriteString(strconv.Itoa(p.Column)) |
| 289 | b.WriteByte('(') |
| 290 | b.WriteString(strconv.Itoa(f.pc)) |
| 291 | b.WriteByte(')') |
| 292 | if f.prg.funcName != "" { |
| 293 | b.WriteByte(')') |
| 294 | } |
| 295 | } else { |
| 296 | if f.funcName != "" { |
| 297 | b.WriteString(f.funcName.String()) |
| 298 | b.WriteString(" (") |
| 299 | } |
| 300 | b.WriteString("native") |
| 301 | if f.funcName != "" { |
| 302 | b.WriteByte(')') |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | // An un-catchable exception is not catchable by try/catch statements (finally is not executed either), |
| 308 | // but it is returned as an error to a Go caller rather than causing a panic. |
no test coverage detected