From 766c097fae7d5bf7a4b876e87522fe08da5d4856 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 7 Feb 2017 13:44:21 +0100 Subject: [PATCH] jump to the end if no breakpoint --- src/code/breakpointManager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/code/breakpointManager.js b/src/code/breakpointManager.js index e2d20a58f3..ccb6283dca 100644 --- a/src/code/breakpointManager.js +++ b/src/code/breakpointManager.js @@ -26,7 +26,7 @@ class breakpointManager { * start looking for the next breakpoint * */ - async play () { + async play (defaultToEnd) { this.isPlaying = true var sourceLocation for (var currentStep = this.debugger.currentStepIndex + 1; currentStep < this.debugger.traceManager.trace.length; currentStep++) { @@ -38,6 +38,9 @@ class breakpointManager { if (this.locationToRowConverter) { var lineColumn = this.locationToRowConverter(sourceLocation) if (this.currentLine === lineColumn.start.line) { + if (defaultToEnd && currentStep === this.debugger.traceManager.trace.length - 1) { + this.debugger.stepManager.jumpTo(currentStep) // jump to the end + } continue } this.currentLine = lineColumn.start.line