Skip to content

Commit

Permalink
Ignore false matches from CoffeeScript codebase
Browse files Browse the repository at this point in the history
I'm not sure this is the best fix for this bug, which was hard to track down! But I have also attempted to address it here: evanw/node-source-map-support#283 although looking at the activity on that repo, I don't have much hope of it being merged any time soon… Hence the reason for this PR.

See also: evanw/node-source-map-support#254
  • Loading branch information
danielbayley committed Oct 15, 2020
1 parent 7a26340 commit 81a1a95
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate
* JSON.
*/
function parseSourceMapInput(str) {
// Ignore false matches from CoffeeScript codebase.
if (str.startsWith('zw(u')) return { version: 3, sources: [], mappings: [] }
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
}
exports.parseSourceMapInput = parseSourceMapInput;
Expand Down

0 comments on commit 81a1a95

Please sign in to comment.