File tree 4 files changed +13
-22
lines changed
4 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 67
67
68
68
nyc . writeProcessIndex ( )
69
69
70
+ nyc . maybePurgeSourceMapCache ( )
70
71
if ( argv . checkCoverage ) {
71
72
nyc . checkCoverage ( {
72
73
lines : argv . lines ,
Original file line number Diff line number Diff line change @@ -236,6 +236,12 @@ class NYC {
236
236
return this . _transform ( code , filename )
237
237
}
238
238
239
+ maybePurgeSourceMapCache ( ) {
240
+ if ( ! this . cache ) {
241
+ this . sourceMaps . purgeCache ( )
242
+ }
243
+ }
244
+
239
245
_transformFactory ( cacheDir ) {
240
246
const instrumenter = this . instrumenter ( )
241
247
let instrumented
Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ const libSourceMaps = require('istanbul-lib-source-maps')
4
4
const fs = require ( 'fs' )
5
5
const path = require ( 'path' )
6
6
7
- const sourceMapCache = libSourceMaps . createSourceMapStore ( )
8
7
function SourceMaps ( opts ) {
9
8
this . cache = opts . cache
10
9
this . cacheDirectory = opts . cacheDirectory
11
10
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 = { }
13
17
}
14
18
15
19
SourceMaps . prototype . extractAndRegister = function ( code , filename , hash ) {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments