Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Report {
for (const v8ScriptCov of v8ProcessCov.result) {
try {
const sources = this._getSourceMap(v8ScriptCov)
const path = resolve(this.resolve, v8ScriptCov.url)
const path = resolve(this.resolve, fileURLToPath(v8ScriptCov.url))
const converter = v8toIstanbul(path, this.wrapperLength, sources, (path) => {
if (this.excludeAfterRemap) {
return !this._shouldInstrument(path)
Expand Down Expand Up @@ -146,7 +146,7 @@ class Report {
*/
_getSourceMap (v8ScriptCov) {
const sources = {}
const sourceMapAndLineLengths = this.sourceMapCache[pathToFileURL(v8ScriptCov.url).href]
const sourceMapAndLineLengths = this.sourceMapCache[v8ScriptCov.url]
if (sourceMapAndLineLengths) {
// See: https://github.com/nodejs/node/pull/34305
if (!sourceMapAndLineLengths.data) return
Expand Down Expand Up @@ -346,15 +346,15 @@ class Report {
}
if (/^file:\/\//.test(v8ScriptCov.url)) {
try {
v8ScriptCov.url = fileURLToPath(v8ScriptCov.url)
fileIndex.add(v8ScriptCov.url)
} catch (err) {
debuglog(`${err.stack}`)
continue
}
}
if ((!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
if (this.excludeAfterRemap || this._shouldInstrument(v8ScriptCov.url)) {

if ((!this.omitRelative || /^file:\/\//.test(v8ScriptCov.url))) {
if (this.excludeAfterRemap || this.exclude.shouldInstrument(fileURLToPath(v8ScriptCov.url))) {
result.push(v8ScriptCov)
}
}
Expand All @@ -374,7 +374,7 @@ class Report {
_normalizeSourceMapCache (v8SourceMapCache) {
const cache = {}
for (const fileURL of Object.keys(v8SourceMapCache)) {
cache[pathToFileURL(fileURLToPath(fileURL)).href] = v8SourceMapCache[fileURL]
cache[fileURL] = v8SourceMapCache[fileURL];
}
return cache
}
Expand Down