本文整理匯總了TypeScript中vscode-debugadapter-testsupport.DebugClient.stepOutRequest方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DebugClient.stepOutRequest方法的具體用法?TypeScript DebugClient.stepOutRequest怎麽用?TypeScript DebugClient.stepOutRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode-debugadapter-testsupport.DebugClient
的用法示例。
在下文中一共展示了DebugClient.stepOutRequest方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should inspect console evaluation results after stepping', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 25 ]);
util.evaluate(dc, 'factorial(3)');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let stackTrace = await dc.stackTraceRequest({ threadId: stoppedEvent.body.threadId! });
let evalResult = await dc.evaluateRequest({ expression: 'obj', context: 'repl',
frameId: stackTrace.body.stackFrames[0].id });
dc.stepOutRequest({ threadId: stoppedEvent.body.threadId! });
await util.receiveStoppedEvent(dc);
dc.stepOutRequest({ threadId: stoppedEvent.body.threadId! });
await util.receiveStoppedEvent(dc);
let inspectResult = await dc.variablesRequest({
variablesReference: evalResult.body.variablesReference
});
assert.equal(util.findVariable(inspectResult.body.variables, 'x').value, '17');
});
示例2: it
it('should inspect return values on stepping out', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 71 ]);
util.evaluate(dc, 'doEval(17)');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let threadId = stoppedEvent.body.threadId!;
await dc.stepOutRequest({ threadId });
await util.receiveStoppedEvent(dc);
let stackTrace = await dc.stackTraceRequest({ threadId: stoppedEvent.body.threadId! });
let scopes = await dc.scopesRequest({ frameId: stackTrace.body.stackFrames[0].id });
let variables = await dc.variablesRequest({ variablesReference: scopes.body.scopes[0].variablesReference });
assert.equal(util.findVariable(variables.body.variables, 'Return value').value, 17);
});
示例3: function
it.skip('should inspect return values on stepping out of recursive functions', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 25 ]);
util.evaluate(dc, 'factorial(4)');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let threadId = stoppedEvent.body.threadId!;
for (let i = 0; i < 4; i++) {
await dc.stepOutRequest({ threadId });
await util.receiveStoppedEvent(dc);
let stackTrace = await dc.stackTraceRequest({ threadId: stoppedEvent.body.threadId! });
let scopes = await dc.scopesRequest({ frameId: stackTrace.body.stackFrames[0].id });
let variables = await dc.variablesRequest({ variablesReference: scopes.body.scopes[0].variablesReference });
assert.equal(util.findVariable(variables.body.variables, 'Return value').value, factorial(i + 1));
}
});
示例4: it
it('should step out', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 3 ]);
util.evaluate(dc, 'vars()');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let threadId = stoppedEvent.body.threadId!;
let stackTrace = await dc.stackTraceRequest({ threadId });
assert.equal(stackTrace.body.stackFrames[0].source!.path, sourcePath);
assert.equal(stackTrace.body.stackFrames[0].line, 3);
dc.stepOutRequest({ threadId });
await util.receiveStoppedEvent(dc);
stackTrace = await dc.stackTraceRequest({ threadId });
assert.equal(stackTrace.body.stackFrames[0].source!.path, sourcePath);
assert.equal(stackTrace.body.stackFrames[0].line, 21);
});
示例5:
await util.runCommandAndReceiveStoppedEvent(dc, () => dc.stepOutRequest({ threadId }));