You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I ran into a possible bug: when I try to resolve a position in a file that isn't covered by an inline source map mapping, the .resolve() method returns an object which points to the file itself instead of its source, and doesn't signal this "resolution failure" in any way.
The TMP tests show this on a file where I discovered it. It's compiled from typescript, and it looks like the typescript compiler doesn't include the leading spaces in the mappings => when I try to resolve a line from column=1 (I don't have the column number), the resolution fails.
Obviously, the ideal would be if it resolved, but it should at least warn that the resolution failed. As it is, there's no way to detect it. (That, and perhaps the sourceFile could be set anyway? I mean, the filename is there, even if the mapping failed...)
The text was updated successfully, but these errors were encountered:
I dove into the code and unfortunately, I think the resolution failure itself is caused by this bug in source-map: mozilla/source-map#261 Which looks a bit abandoned, sigh.
Still, it would be nice if this module could at least signal that this error happened. Maybe use the error key?
Hi, I ran into a possible bug: when I try to resolve a position in a file that isn't covered by an inline source map mapping, the
.resolve()
method returns an object which points to the file itself instead of its source, and doesn't signal this "resolution failure" in any way.I forked the repo and wrote some (failing) tests that demonstrate the problem: https://github.com/corvidism/get-source/pull/1/files
The
TMP
tests show this on a file where I discovered it. It's compiled from typescript, and it looks like thetypescript
compiler doesn't include the leading spaces in the mappings => when I try to resolve a line fromcolumn=1
(I don't have the column number), the resolution fails.Obviously, the ideal would be if it resolved, but it should at least warn that the resolution failed. As it is, there's no way to detect it. (That, and perhaps the
sourceFile
could be set anyway? I mean, the filename is there, even if the mapping failed...)The text was updated successfully, but these errors were encountered: