Insert moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. http://www.lua.org/manual/5.2/manual.html#lua_insert
(index int)
| 589 | // |
| 590 | // http://www.lua.org/manual/5.2/manual.html#lua_insert |
| 591 | func (l *State) Insert(index int) { |
| 592 | apiCheckStackIndex(index, l.indexToValue(index)) |
| 593 | i := l.callInfo.function + l.AbsIndex(index) |
| 594 | copy(l.stack[i+1:l.top+1], l.stack[i:l.top]) |
| 595 | l.stack[i] = l.stack[l.top] |
| 596 | } |
| 597 | |
| 598 | func (l *State) move(dest int, src value) { l.setIndexToValue(dest, src) } |
| 599 |
no test coverage detected