MCPcopy Index your code
hub / github.com/gopherjs/gopherjs / methodName

Method methodName

compiler/utils.go:481–488  ·  view source on GitHub ↗

methodName returns a JS identifier (specifically, object property name) corresponding to the given method.

(fun *types.Func)

Source from the content-addressed store, hash-verified

479// methodName returns a JS identifier (specifically, object property name)
480// corresponding to the given method.
481func (fc *funcContext) methodName(fun *types.Func) string {
482 if fun.Type().(*types.Signature).Recv() == nil {
483 panic(fmt.Errorf("expected a method, got a standalone function %v", fun))
484 }
485 // Method names are scoped to their receiver type and guaranteed to be
486 // unique within that, so we only need to make sure it's not a reserved keyword
487 return sanitizeName(fun.Name())
488}
489
490func (fc *funcContext) varPtrName(o *types.Var) string {
491 if isPkgLevel(o) {

Callers 2

translateExprMethod · 0.95
translateMethodMethod · 0.95

Calls 4

sanitizeNameFunction · 0.85
RecvMethod · 0.65
TypeMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected