fix(selectivity): include browser function-less files#1219
fix(selectivity): include browser function-less files#1219KuznetsovRoman merged 1 commit intomasterfrom
Conversation
commit: |
| sourceString, | ||
| sourceMapsString, | ||
| Array.from(startOffsetsSet), | ||
| grouppedByScriptCoverage[scriptId], |
There was a problem hiding this comment.
Now passing full coverage, with ranges
Ranges are necessary to perform source map function bounds checking
| const previousPosition = consumer.originalPositionFor({ | ||
| line: startLine + 1, | ||
| column, | ||
| bias: SourceMapConsumer.GREATEST_LOWER_BOUND, |
There was a problem hiding this comment.
With "GREATEST_LOWER_BOUND" bias (which is default) we might get position, before the actual function
So after calling "generatedPositionFor" we check generatedPosition.line >= startLine + 1 which ensures "source map is in function boundaries"
| break; | ||
| } | ||
|
|
||
| (previousPosition as SourceFindPosition).bias = SourceMapConsumer.GREATEST_LOWER_BOUND; |
There was a problem hiding this comment.
Reusing "previousPosition" object
| const nextPosition = consumer.originalPositionFor({ | ||
| line: startLine + 1, | ||
| column, | ||
| bias: SourceMapConsumer.LEAST_UPPER_BOUND, |
There was a problem hiding this comment.
When processing bundler wrapper, we dont get valid source position with "GREATEST_LOWER_BOUND"
So we use "LEAST_UPPER_BOUND", which is looking for "next mapping" instead of "previous mapping"
generatedPosition.line <= endLine + 1 check insures we did not jump to another function
src/browser/cdp/selectivity/utils.ts
Outdated
|
|
||
| if (previousPosition.source) { | ||
| if (dependantSourceFiles.has(previousPosition.source)) { | ||
| break; |
There was a problem hiding this comment.
Breaks our of const range of functionCall.ranges loop, as "function" is already processed
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c26b09c07a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c26b09c to
ffd851c
Compare
ffd851c to
60def12
Compare
No description provided.