summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/natives/src/testing/testing.go
blob: 392f1f87c74f47a708e932bf87ae8e33fecd311a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// +build js

package testing

import "runtime"

// The upstream callerName and frameSkip rely on runtime.Callers,
// and panic if there are zero callers found. However, runtime.Callers
// is not implemented for GopherJS at this time, so we can't use
// that implementation. Use these stubs instead.
func callerName(skip int) string {
	// Upstream callerName requires a functional runtime.Callers.
	// TODO: Implement if possible.
	return "<unknown>"
}

func (*common) frameSkip(skip int) runtime.Frame {
	_, file, line, ok := runtime.Caller(skip)
	if !ok {
		return runtime.Frame{}
	}
	return runtime.Frame{
		File: file,
		Line: line,
	}
}