-
Notifications
You must be signed in to change notification settings - Fork 362
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
originalPositionFor returns null if sourcemap does not contains the exact line. #261
Comments
Related to: |
Over in #220 the proposal is to remove "fuzzy mapping" from another API. It would be funny to change that one to be more strict while changing this one to be less so -- but maybe that's even the best thing to do. |
I see now that |
For Kotlin the issue is even more important because the mapping is fuzzier in Kotlin than in TypeScript I believe. See istanbuljs/nyc#818 |
Any news about this one? The |
This one would greatly help But one suggestion I'll make here is that as in #220, this could work well as an optional argument. It makes sense to me that some cases might call for strict matching and others fuzzy. I don't have strong feelings about what the default should be -- I personally would be fine keeping strict as the default for backwards compatibility. My main interest is to see |
originalPositionFor returns null if sourcemap does not contains the exact line.
It cause the issue with typescript(ts-node) that may not create source map for all the lines,
especially when the source contains multi-line chained function call like below.
In this case, the error happens on the last line. But, sourcemap does not have information on the line. So, the following code assume the mapping does not found and return null.
source-map/lib/source-map-consumer.js
Line 616 in 75663e0
It is much better to return the nearest source map position, instead of just return null.
The text was updated successfully, but these errors were encountered: