From 81a1a9584d50ddf76e7dd988ad0c6ad86f4f13d2 Mon Sep 17 00:00:00 2001 From: Daniel Bayley Date: Thu, 15 Oct 2020 16:28:16 +0100 Subject: [PATCH] Ignore false matches from CoffeeScript codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/evanw/node-source-map-support/issues/254 --- lib/util.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/util.js b/lib/util.js index 1f810af1..d3ab3cf5 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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;