Open
Description
Consider this example:
function inlineMe(param) {
beforeI;
console.log(param + 3);
afterI;
}
function fn(param) {
beforeF;
inlineMe(4 * otherFn(param));
afterF;
}
fn(1);
That is compiled to
function fn(param) {
beforeF;
beforeI;
console.log(4 * otherFn(param) + 3);
afterI;
afterF;
}
fn(1);
My initial naive implementation was to have three generated ranges:
- one for the whole program
- one going from
beforeF
toafterF
, pointing tofn
's original scope - one going from
beforeI
toafterI
, pointing toinlineMe
's original scope
However, with those generated ranges, when placing a breakpoint right before the otherFn(param)
call you would see the value for param
as 4
rather than 1
.
I think the correct generated ranges are either:
- one for the whole program
- one going from
beforeF
toafterF
, pointing tofn
's original scope - one going from
beforeI
toafterI
, pointing toinlineMe
's original scope - one covering
4 * otherFn(param)
, pointing tofn
's original scope
or:
- one for the whole program
- one going from
beforeF
toafterF
, pointing tofn
's original scope - one going from
beforeI
to right before4 * otherFn(param)
, pointing toinlineMe
's original scope - one going from
+ 3
toafterI
, pointing toinlineMe
's original scope
And I also think that the first one is slightly better since it better represents the stack trace when paused at that breakpoint.
Am I interpreting this correctly?