Skip to content

Commit 9df6bec

Browse files
authored
Merge pull request #1 from danielbayley/patch-1
Fix retrieveSourceMapURL to prevent false matches in CoffeeScript cod…
2 parents 7b5b81e + 357f56c commit 9df6bec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source-map-support.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ function retrieveSourceMapURL(source) {
167167

168168
// Get the URL of the source map
169169
fileData = retrieveFile(source);
170+
// Skip sourceMappingURL in coffeescript.js, meant for emitting source maps.
171+
if (source.endsWith('node_modules/coffeescript/lib/coffeescript/coffeescript.js')) return null
170172
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
171173
// Keep executing the search to find the *last* sourceMappingURL to avoid
172174
// picking up sourceMappingURLs from comments, strings, etc.

0 commit comments

Comments
 (0)