async function set_breakpoints(packet, threadFront) { const source = await getSourceById(threadFront, packet.frame.where.actor); returnnew Promise(resolve => {
let first, second;
source.setBreakpoint(firstLocation).then(function ([
{ actualLocation },
breakpointClient,
]) { Assert.ok(!actualLocation, "Should not get an actualLocation");
first = breakpointClient;
source.setBreakpoint(secondLocation).then(function ([
{ actualLocation },
breakpointClient,
]) { Assert.ok(!actualLocation, "Should not get an actualLocation");
second = breakpointClient;
resolve([first, second]);
});
});
});
}
function test_different_actors(first, second) { Assert.notEqual(
first.actor,
second.actor, "Each breakpoint should have a different actor"
);
}
function test_remove_one(first, second, threadFront, debuggee) { returnnew Promise(resolve => {
first.remove(function ({ error }) { Assert.ok(!error, "Should not get an error removing a breakpoint");
let hitSecond;
threadFront.on("paused", function _onPaused({ why, frame }) { if (why.type == "breakpoint") {
hitSecond = true; Assert.equal(
why.actors.length,
1, "Should only be paused because of one breakpoint actor"
); Assert.equal(
why.actors[0],
second.actor, "Should be paused because of the correct breakpoint actor"
); Assert.equal(
frame.where.line,
secondLocation.line, "Should be at the right line"
); Assert.equal(
frame.where.column,
secondLocation.column, "Should be at the right column"
);
threadFront.resume(); return;
}
if (why.type == "debuggerStatement") {
threadFront.off("paused", _onPaused); Assert.ok(
hitSecond, "We should still hit `second`, but not `first`."
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.