| 161 | } |
| 162 | |
| 163 | func pushGlobalFunctionName(l *State, f Frame) bool { |
| 164 | top := l.Top() |
| 165 | Info(l, "f", f) // push function |
| 166 | l.PushGlobalTable() |
| 167 | if findField(l, top+1, 2) { |
| 168 | l.Copy(-1, top+1) // move name to proper place |
| 169 | l.Pop(2) // remove pushed values |
| 170 | return true |
| 171 | } |
| 172 | l.SetTop(top) // remove function and global table |
| 173 | return false |
| 174 | } |
| 175 | |
| 176 | func typeError(l *State, argCount int, typeName string) { |
| 177 | ArgumentError(l, argCount, l.PushString(typeName+" expected, got "+TypeNameOf(l, argCount))) |