Closed Bug 1432985 Opened 6 years ago Closed 5 years ago

Step Over should ignore object properties and arguments

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox60 --- affected

People

(Reporter: jlast, Unassigned)

References

Details

The debugger currently pauses on each new line which has an entryPoint. This creates several unnecessary steps such as object properties are call expression arguments which are literals:


GIF: http://g.recordit.co/j1e3nOUmie.gif
Example: https://silly-stepping.glitch.me/

A naive solution would be to ignore all objects, arrays, and arguments. Note, this is what chrome does.

Perhaps, a better solution would be to ignore literals and pause at each expression.
The solution could potentially live in actors/script.js#makeOnStep or in debugger.cpp. 

Would it be possible to not consider some of the literal cases entry points?
Blocks: js-devtools
It would also be nice to not allow breakpoints at these locations: http://g.recordit.co/X4L84gWZ5x.gif (same gif as comment 2)
Priority: -- → P3
Here is a code sample

> function stuff() {
>   const a = {
>     a: 1,
>     b: 2
>   }
>   
>   const b = [
>     1,
>     2
>   ]
>   
>   funca({
>     a: 1,
>     b: funcb()
>   }, 
>     funcb()
>   )
>   
> }
>
One proposal is to pause at every call expression, member expression, or identifier:

1. loops
> while(true) foo()

2. array expression
> [foo(), bar()]

3. variable declarator
> var x = [
>   'a',
>  foo()
> ]

4. assingment expression
> var a = 2, 
>   b = foo(), 
>   c = bar()

5. binary operator
> foo() + bar()

that brings up some cases. pausing at all of the expressions seems fine, because the user can always continue to another breakpoint, but it can also be a lot. If we want to persue this idea, but be smarter we would need to decide if we should pause based on the previous location and perhaps an ancestor node... that does make it more complicated.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.