MCPcopy Index your code
hub / github.com/Shopify/go-lua / functionName

Method functionName

debug.go:228–272  ·  view source on GitHub ↗
(ci *callInfo)

Source from the content-addressed store, hash-verified

226}
227
228func (l *State) functionName(ci *callInfo) (name, kind string) {
229 if ci == &l.baseCallInfo {
230 return
231 }
232 var tm tm
233 p := l.prototype(ci)
234 pc := ci.savedPC
235 switch i := p.code[pc]; i.opCode() {
236 case opCall, opTailCall:
237 return p.objectName(i.a(), pc)
238 case opTForCall:
239 return "for iterator", "for iterator"
240 case opSelf, opGetTableUp, opGetTable:
241 tm = tmIndex
242 case opSetTableUp, opSetTable:
243 tm = tmNewIndex
244 case opEqual:
245 tm = tmEq
246 case opAdd:
247 tm = tmAdd
248 case opSub:
249 tm = tmSub
250 case opMul:
251 tm = tmMul
252 case opDiv:
253 tm = tmDiv
254 case opMod:
255 tm = tmMod
256 case opPow:
257 tm = tmPow
258 case opUnaryMinus:
259 tm = tmUnaryMinus
260 case opLength:
261 tm = tmLen
262 case opLessThan:
263 tm = tmLT
264 case opLessOrEqual:
265 tm = tmLE
266 case opConcat:
267 tm = tmConcat
268 default:
269 return
270 }
271 return eventNames[tm], "metamethod"
272}
273
274func (l *State) collectValidLines(f closure) {
275 if lc, ok := f.(*luaClosure); !ok {

Callers 1

InfoFunction · 0.45

Calls 4

prototypeMethod · 0.95
opCodeMethod · 0.80
objectNameMethod · 0.80
aMethod · 0.80

Tested by

no test coverage detected