Context is called by a continuation function to retrieve the status of the thread and context information. When called in the origin function, it will always return (0, false, nil). When called inside a continuation function, it will return (ctx, shouldYield, err), where ctx is the value that was pa
()
| 321 | // |
| 322 | // http://www.lua.org/manual/5.2/manual.html#lua_getctx |
| 323 | func (l *State) Context() (int, bool, error) { |
| 324 | if l.callInfo.isCallStatus(callStatusYielded) { |
| 325 | return l.callInfo.context, l.callInfo.shouldYield, l.callInfo.error |
| 326 | } |
| 327 | return 0, false, nil |
| 328 | } |
| 329 | |
| 330 | // CallWithContinuation is exactly like Call, but allows the called function to |
| 331 | // yield. |
no test coverage detected