(t value, key value)
| 20 | } |
| 21 | |
| 22 | func (l *State) tableAt(t value, key value) value { |
| 23 | for loop := 0; loop < maxTagLoop; loop++ { |
| 24 | var tm value |
| 25 | if table, ok := t.(*table); ok { |
| 26 | if result := table.at(key); result != nil { |
| 27 | return result |
| 28 | } else if tm = l.fastTagMethod(table.metaTable, tmIndex); tm == nil { |
| 29 | return nil |
| 30 | } |
| 31 | } else if tm = l.tagMethodByObject(t, tmIndex); tm == nil { |
| 32 | l.typeError(t, "index") |
| 33 | } |
| 34 | switch tm.(type) { |
| 35 | case closure, *goFunction: |
| 36 | return l.callTagMethod(tm, t, key) |
| 37 | } |
| 38 | t = tm |
| 39 | } |
| 40 | l.runtimeError("loop in table") |
| 41 | return nil |
| 42 | } |
| 43 | |
| 44 | func (l *State) setTableAt(t value, key value, val value) { |
| 45 | for loop := 0; loop < maxTagLoop; loop++ { |
no test coverage detected