Open Bug 1482003 Opened 7 years ago Updated 2 years ago

The 2nd iteration in for-of loop unexpectedly stops at iterated expression when stepping in debugger

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox63 --- affected

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file a.html
Steps to reproduce: 1. Run Firefox Nightly 63.0a1 (2018-08-07) (64-bit) 2. open the attached file 3. set breakpoint in line 6 (`console.log("0")` line) 4. reload the file 5. click "Step over" ~20 times Actual result: the cursor moves to the following lines on each click: * line 7: for * line 12: iterated * line 7: for * line 9: let * line 16: console.log("x"); * line 17: console.log(x); * line 12: iterated * line 7: for * line 9: let * line 16: console.log("x"); * line 17: console.log(x); * line 12: iterated * line 7: for * line 9: let * line 16: console.log("x"); * line 17: console.log(x); * line 12: iterated * line 7: for * line 19: </script> Expected result: cursor doesn't move to `iterated` for 2nd and later iterations. This should be because we're attributing JSOP_LOOPENTRY with `iterated`'s position. surrounding code is touched by bug 1456404. I'll look into this after fixing it.
some more thoughts. it's indeed performing iteration protocol on the iterated value, so it might make sense that it stops at that position, but at the same time it's confusing because it's different than the 1st iteration which also stops at the same position for both evaluating the iterated value itself and the beginning of iteration protocol.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: