File tree Expand file tree Collapse file tree 4 files changed +13
-22
lines changed Expand file tree Collapse file tree 4 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 6767
6868 nyc . writeProcessIndex ( )
6969
70+ nyc . maybePurgeSourceMapCache ( )
7071 if ( argv . checkCoverage ) {
7172 nyc . checkCoverage ( {
7273 lines : argv . lines ,
Original file line number Diff line number Diff line change @@ -236,6 +236,12 @@ class NYC {
236236 return this . _transform ( code , filename )
237237 }
238238
239+ maybePurgeSourceMapCache ( ) {
240+ if ( ! this . cache ) {
241+ this . sourceMaps . purgeCache ( )
242+ }
243+ }
244+
239245 _transformFactory ( cacheDir ) {
240246 const instrumenter = this . instrumenter ( )
241247 let instrumented
Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ const libSourceMaps = require('istanbul-lib-source-maps')
44const fs = require ( 'fs' )
55const path = require ( 'path' )
66
7- const sourceMapCache = libSourceMaps . createSourceMapStore ( )
87function SourceMaps ( opts ) {
98 this . cache = opts . cache
109 this . cacheDirectory = opts . cacheDirectory
1110 this . loadedMaps = { }
12- this . _sourceMapCache = sourceMapCache
11+ this . _sourceMapCache = libSourceMaps . createSourceMapStore ( )
12+ }
13+
14+ SourceMaps . prototype . purgeCache = function ( ) {
15+ this . _sourceMapCache = libSourceMaps . createSourceMapStore ( )
16+ this . loadedMaps = { }
1317}
1418
1519SourceMaps . prototype . extractAndRegister = function ( code , filename , hash ) {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments