CaptureContinuation() public method

Capture a continuation from the current execution.
Capture a continuation from the current execution. The execution must have been started via a call to ExecuteScriptWithContinuations(Script, Scriptable) or CallFunctionWithContinuations(Callable, Scriptable, object[]) . This implies that the code calling this method must have been called as a function from the JavaScript script. Also, there cannot be any non-JavaScript code between the JavaScript frames (e.g., a call to eval()). The ContinuationPending exception returned must be thrown.
public CaptureContinuation ( ) : ContinuationPending
return ContinuationPending
Example #1
0
		public static object Continuation(Context cx, Scriptable thisObj, object[] args, Function funObj)
		{
			ContinuationPending pending = cx.CaptureContinuation();
			throw pending;
		}