internal async Task<JObject> StepAndCheck (StepKind kind, string script_loc, int line, int column, string function_name, Func<JObject, Task> wait_for_event_fn = null, Action<JToken> locals_fn = null, int times=1) { for (int i = 0; i < times - 1; i ++) { await SendCommandAndCheck (null, $"Debugger.step{kind.ToString ()}", null, -1, -1, null); } // Check for method/line etc only at the last step return await SendCommandAndCheck ( null, $"Debugger.step{kind.ToString ()}", script_loc, line, column, function_name, wait_for_event_fn: wait_for_event_fn, locals_fn: locals_fn); }
async Task <JObject> StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name, DebugTestContext ctx, Func <JObject, Task> wait_for_event_fn = null, Action <JToken> locals_fn = null, int times = 1) { for (int i = 0; i < times - 1; i++) { await SendCommandAndCheck(null, $"Debugger.step{kind.ToString ()}", ctx); } // Check for method/line etc only at the last step return(await SendCommandAndCheck( null, $"Debugger.step{kind.ToString ()}", ctx, wait_for_event_fn: async(pause_location) => { await CheckLocalsOnFrame(pause_location ["callFrames"][0], script_loc, line, column, function_name, ctx); if (wait_for_event_fn != null) { await wait_for_event_fn(pause_location); } }, locals_fn : locals_fn)); }
public SExp CreateStepExpression(Token keyword, Token name, StepKind stepKind) { return new SExpList("step", new SExp(FormatPosition(keyword.Position)), new SExp(stepKind.ToString()), new SExp(keyword.Content), new SExp(name.Content)); }