MCPcopy
hub / github.com/gopherjs/gopherjs / FuncOf

Function FuncOf

compiler/natives/src/reflect/reflect.go:192–206  ·  view source on GitHub ↗

gopherjs:replace

(in, out []Type, variadic bool)

Source from the content-addressed store, hash-verified

190
191//gopherjs:replace
192func FuncOf(in, out []Type, variadic bool) Type {
193 if variadic && (len(in) == 0 || in[len(in)-1].Kind() != Slice) {
194 panic("reflect.FuncOf: last arg of variadic func must be slice")
195 }
196
197 jsIn := make([]*js.Object, len(in))
198 for i, v := range in {
199 jsIn[i] = jsType(v)
200 }
201 jsOut := make([]*js.Object, len(out))
202 for i, v := range out {
203 jsOut[i] = jsType(v)
204 }
205 return toRType(abi.ReflectType(js.Global.Call("$funcType", jsIn, jsOut, variadic)))
206}
207
208//gopherjs:replace
209func MapOf(key, elem Type) Type {

Callers 1

MethodMethod · 0.70

Calls 4

toRTypeFunction · 0.85
jsTypeFunction · 0.70
KindMethod · 0.65
CallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…