(t1, t2 value)
| 97 | } |
| 98 | |
| 99 | func (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 | |
| 120 | func (l *State) callBinaryTagMethod(p1, p2 value, event tm) (value, bool) { |
| 121 | tm := l.tagMethodByObject(p1, event) |
no test coverage detected