Bug 1506739 - Fix problems when stepping out of frames while replaying, r=jlast.

--HG--
extra : rebase_source : 1af01f8e4b40b6aa34c1e3c8ae503e5d3c1198aa
This commit is contained in:
Brian Hackett 2018-11-13 08:06:16 -10:00
Родитель b5b531436f
Коммит ced41bdf02
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -545,10 +545,20 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
if (steppingType == "finish") {
const parentFrame = thread._getNextStepFrame(this);
if (parentFrame && parentFrame.script) {
// We can't use the completion value in stepping hooks if we're
// replaying, as we can't use its contents after resuming.
const ncompletion = thread.dbg.replaying ? null : completion;
const { onStep, onPop } = thread._makeSteppingHooks(
originalLocation, "next", false, completion
originalLocation, "next", false, ncompletion
);
parentFrame.onStep = onStep;
if (thread.dbg.replaying) {
const offsets =
thread._findReplayingStepOffsets(originalLocation, parentFrame,
/* rewinding = */ false);
parentFrame.setReplayingOnStep(onStep, offsets);
} else {
parentFrame.onStep = onStep;
}
// We need the onPop alongside the onStep because it is possible that
// the parent frame won't have any steppable offsets, and we want to
// make sure that we always pause in the parent _somewhere_.