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

Method equalObjects

vm.go:99–118  ·  view source on GitHub ↗
(t1, t2 value)

Source from the content-addressed store, hash-verified

97}
98
99func (l *State) equalObjects(t1, t2 value) bool {
100 var tm value
101 switch t1 := t1.(type) {
102 case *userData:
103 if t1 == t2 {
104 return true
105 } else if t2, ok := t2.(*userData); ok {
106 tm = l.equalTagMethod(t1.metaTable, t2.metaTable, tmEq)
107 }
108 case *table:
109 if t1 == t2 {
110 return true
111 } else if t2, ok := t2.(*table); ok {
112 tm = l.equalTagMethod(t1.metaTable, t2.metaTable, tmEq)
113 }
114 default:
115 return t1 == t2
116 }
117 return tm != nil && !isFalse(l.callTagMethod(tm, t1, t2))
118}
119
120func (l *State) callBinaryTagMethod(p1, p2 value, event tm) (value, bool) {
121 tm := l.tagMethodByObject(p1, event)

Callers 4

CompareMethod · 0.95
executeSwitchMethod · 0.95
nextMethod · 0.95
initFunction · 0.80

Calls 3

equalTagMethodMethod · 0.95
callTagMethodMethod · 0.95
isFalseFunction · 0.85

Tested by

no test coverage detected