ProtectedCall calls a function in protected mode. Both argCount and resultCount have the same meaning as in Call. If there are no errors during the call, ProtectedCall behaves exactly like Call. However, if there is any error, ProtectedCall catches it, pushes a single value on the stack (the error
(argCount, resultCount, errorFunction int)
| 379 | // |
| 380 | // http://www.lua.org/manual/5.2/manual.html#lua_pcall |
| 381 | func (l *State) ProtectedCall(argCount, resultCount, errorFunction int) error { |
| 382 | return l.ProtectedCallWithContinuation(argCount, resultCount, errorFunction, 0, nil) |
| 383 | } |
| 384 | |
| 385 | // ProtectedCallWithContinuation behaves exactly like ProtectedCall, but |
| 386 | // allows the called function to yield. |