MCPcopy Create free account
hub / github.com/dop251/goja / Write

Method Write

runtime.go:273–305  ·  view source on GitHub ↗
(b *bytes.Buffer)

Source from the content-addressed store, hash-verified

271}
272
273func (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.

Callers 6

strMethod · 0.80
hashMethod · 0.80
writeFullStackMethod · 0.80
writeShortStackMethod · 0.80
StopProfileFunction · 0.80
writeMethod · 0.80

Calls 3

PositionMethod · 0.95
WriteStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected