Skip to content

Commit 0927aef

Browse files
committed
compiler/natives/src/runtime: Add noop implementation of CallersFrames.
In Go 1.9, runtime.panicwrap uses CallersFrames. So it needs to be implemented (as well as the types it uses). Create a noop implementation for now to resolve an undeclared name error. A more functioning implementation may be possible, and needs to be investigated (see Caller implementation for inspiration). Fixes: ../src/runtime/error.go:136:12: undeclared name: CallersFrames
1 parent 72e0b64 commit 0927aef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

compiler/natives/src/runtime/runtime.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ func Callers(skip int, pc []uintptr) int {
6363
return 0
6464
}
6565

66+
// CallersFrames is not implemented for GOARCH=js.
67+
// TODO: Implement if possible.
68+
func CallersFrames(callers []uintptr) *Frames { return &Frames{} }
69+
70+
type Frames struct{}
71+
72+
func (ci *Frames) Next() (frame Frame, more bool) { return }
73+
74+
type Frame struct {
75+
PC uintptr
76+
Func *Func
77+
Function string
78+
File string
79+
Line int
80+
Entry uintptr
81+
}
82+
6683
func GC() {
6784
}
6885

0 commit comments

Comments
 (0)