whitespace trimming approach to fix #81 #179
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims at improving the precision of the v8 range mapping trimming the whitespaces.
e.g. #81 is caused by:
v8-to-istanbul/lib/v8-to-istanbul.js
Lines 179 to 181 in 53c1cd8
because the v8 startOffset is 50 while the line startCol is 48.
I introduced minCol and maxCol which take into account the gaps caused by whitespaces and now the matching
seems more accurate.
With the trimming in place c8 tests are all green except from the following 7 cases:
These differences look promising (the new range cover the method signatures which in the past were missing):
Instead I am still investigating these two cases (the min/max ranges seem to be remapped correctly by source maps while somethins is off with
this.rawSource
which breakstrimRange
):I preferred to open the PR early to start receiving feedback. I will try to keep the noise to the minimum though!
I am keen to optimise the code but that once we are sure that the changes in the coverage are all good.