Skip to content

JavaScript debugging: run to cursor can skip to next statement if cursor is after semicolon #102199

@mjbvz

Description

@mjbvz

Issue Type: Bug

Repro

  1. For the following node code:
let a = 0;

for (let i = 0; i < 1000; ++i) {
    if (a % 10 === 0) {
        a /= 2;
    }
    a += i;
}

console.log(a);
  1. Use a debug terminal to debug it
  2. Place your cursor at the end of the line after a /= 2; and run Debug: Run to cursor

Expected
Program runs to that line

Actual
The program runs to the next line: a += i:

Screen Shot 2020-07-11 at 12 30 11 AM

Even though this behavior makes sense from a program structure perspective, it still caught me off guard
VS Code version: Code - Insiders 1.48.0-insider (e7920dc, 2020-07-10T11:55:11.286Z)
OS version: Darwin x64 19.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 32.00GB (1.64GB free)
Process Argv
Screen Reader no
VM 15%

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions