Repro for crbug.com/1357506

This illustrates the problem with line breakpoints being inconsistent.

Steps (for await expressions in plain JavaScript)

  1. Reload this page with DevTools open
  2. Open crbug-1357506-await-line-breakpoint.js in the Sources panel
  3. Set a breakpoint in line 7 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the call to foo)
  4. Set a breakpoint in line 10 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the await)
  5. Click and observe that the debugger pauses on line 7 before calling foo
  6. Now press Resume and observe that the debugger is paused on line 10, and foo was called twice meanwhile

Steps (for await expressions in minified TypeScript)

  1. Reload this page with DevTools open
  2. Open crbug-1357506-await-line-breakpoint.ts in the Sources panel
  3. Set a breakpoint in line 7 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the await)
  4. Click and observe that the debugger pauses on line 7 after calling foo

Steps (for for..of expressions)

  1. Reload this page with DevTools open
  2. Open crbug-1357506-forof-line-breakpoint.js in the Sources panel
  3. Set a breakpoint in line 6 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the call to foo)
  4. Set a breakpoint in line 9 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the x)
  5. Click and observe that the debugger pauses on line 6 before calling foo
  6. Now press Resume and observe that the debugger is paused on line 9, and foo was called twice meanwhile

Steps (for destructuring expressions)

  1. Reload this page with DevTools open
  2. Open crbug-1357506-destructuring-line-breakpoint.js in the Sources panel
  3. Set a breakpoint in line 6 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the call to foo)
  4. Set a breakpoint in line 8 by just clicking on the line number in the breakpoint gutter (notice that the breakpoint is set on the x)
  5. Click and observe that the debugger pauses on line 6 before calling foo
  6. Now press Resume and observe that the debugger is paused on line 8, and foo was called twice meanwhile

Bonus points

Click on line 7 and observe that the breakpoint is not set on line 7, which makes sense since it's not breakable, but rather jumps to line 9 (on the call to foo), which is counter-intuitive from the source code perspective.