MCPcopy Index your code
hub / github.com/yuin/gopher-lua / metaOp2

Method metaOp2

state.go:1010–1024  ·  view source on GitHub ↗
(value1, value2 LValue, event string)

Source from the content-addressed store, hash-verified

1008}
1009
1010func (ls *LState) metaOp2(value1, value2 LValue, event string) LValue {
1011 if mt := ls.metatable(value1, true); mt != LNil {
1012 if tb, ok := mt.(*LTable); ok {
1013 if ret := tb.RawGetString(event); ret != LNil {
1014 return ret
1015 }
1016 }
1017 }
1018 if mt := ls.metatable(value2, true); mt != LNil {
1019 if tb, ok := mt.(*LTable); ok {
1020 return tb.RawGetString(event)
1021 }
1022 }
1023 return LNil
1024}
1025
1026func (ls *LState) metaCall(lvalue LValue) (*LFunction, bool) {
1027 if fn, ok := lvalue.(*LFunction); ok {

Callers 4

objectArithFunction · 0.45
stringConcatFunction · 0.45
objectArithFunction · 0.45
stringConcatFunction · 0.45

Calls 2

metatableMethod · 0.95
RawGetStringMethod · 0.80

Tested by

no test coverage detected