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: https://github.com/evanw/node-source-map-support/pull/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 authored and Nicolas Porter committed May 1, 2023
1 parent b2171d5 commit 2d3b249
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 @@ -488,6 +488,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 2d3b249

Please sign in to comment.