Skip to content

Commit 81a1a95

Browse files
authored
Ignore false matches from CoffeeScript codebase
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
1 parent 7a26340 commit 81a1a95

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/util.js

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate
159159
* JSON.
160160
*/
161161
function parseSourceMapInput(str) {
162+
// Ignore false matches from CoffeeScript codebase.
163+
if (str.startsWith('zw(u')) return { version: 3, sources: [], mappings: [] }
162164
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
163165
}
164166
exports.parseSourceMapInput = parseSourceMapInput;

0 commit comments

Comments
 (0)