diff options
author | Jimb Esser <wasteland@gmail.com> | 2021-01-18 15:44:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 07:44:24 +0800 |
commit | 994293e97229110f676dc72ad68b6b2d8a015394 (patch) | |
tree | 9c035e8ae8ee1fd4a01302378dbf8c3a3db985ff /lib/sourcemap.js | |
parent | b57bae4b9e528ec7aeea7fd5768295a559cb5e5d (diff) | |
download | tracifyjs-994293e97229110f676dc72ad68b6b2d8a015394.tar.gz tracifyjs-994293e97229110f676dc72ad68b6b2d8a015394.zip |
Fix overwriting existing sourcesContent in sourcemaps (#4567)
Diffstat (limited to 'lib/sourcemap.js')
-rw-r--r-- | lib/sourcemap.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sourcemap.js b/lib/sourcemap.js index c2587c88..94966a6a 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -144,7 +144,9 @@ function SourceMap(options) { add(source, gen_line, gen_col, orig_line, orig_col, name); } : add, setSourceContent: sources_content ? function(source, content) { - sources_content[source] = content; + if (!(source in sources_content)) { + sources_content[source] = content; + } } : noop, toString: function() { return JSON.stringify({ |