Skip to content

Commit 9639154

Browse files
committed
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 # Conflicts: # lib/util.js
1 parent ac518d2 commit 9639154

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/util.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate
430430
* JSON.
431431
*/
432432
function parseSourceMapInput(str) {
433-
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
433+
// Ignore false matches from CoffeeScript codebase.
434+
if (str.startsWith('zw(u')) return { version: 3, sources: [], mappings: [] }
435+
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
434436
}
435437
exports.parseSourceMapInput = parseSourceMapInput;
436438

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "source-map",
2+
"name": "@42technologies/source-map",
33
"description": "Generates and consumes source maps",
44
"version": "0.6.1",
55
"homepage": "https://github.com/mozilla/source-map",

0 commit comments

Comments
 (0)