New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
istanbul-lib-source-maps
does not preserve implicit else
#705
Comments
This was referenced Nov 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the coverage map is mapped back to sources using
istanbul-lib-source-maps
the implicitelse
gets dropped in the process. Here is the line that checks whether the branch exists in sources, and simply excludes it from results. Since the implicitelse
does not exist in the sources, themapping
variable is falsy.istanbuljs/packages/istanbul-lib-source-maps/lib/transformer.js
Lines 71 to 85 in fb8cb4b
Example of implicit
else
just so that everyone is on the track of what this issue is about:Check the reproduction case below to see how
data.branchMap
anddata.b
loses theelse
branch.Minimal reproduction case
Requirements:
$ npm install istanbul-lib-instrument istanbul-lib-coverage istanbul-lib-source-maps esbuild $ node -v > v16.15.1
Output:
Related issues from downstream:
The text was updated successfully, but these errors were encountered: