methodName returns a JS identifier (specifically, object property name) corresponding to the given method.
(fun *types.Func)
| 479 | // methodName returns a JS identifier (specifically, object property name) |
| 480 | // corresponding to the given method. |
| 481 | func (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 | |
| 490 | func (fc *funcContext) varPtrName(o *types.Var) string { |
| 491 | if isPkgLevel(o) { |
no test coverage detected