Skip to content

Commit

Permalink
Merge 75781a3 into 803d3c3
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Jul 6, 2019
2 parents 803d3c3 + 75781a3 commit 552b897
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/v8-to-istanbul.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { dirname, join } = require('path')
const CovBranch = require('./branch')
const CovFunction = require('./function')
const CovSource = require('./source')
const { readFileSync } = require('fs')
const { readFile } = require('fs').promises
const { SourceMapConsumer } = require('source-map')

const isOlderNode10 = /^v10\.(([0-9]\.)|(1[0-5]\.))/u.test(process.version)
Expand All @@ -28,7 +28,7 @@ module.exports = class V8ToIstanbul {
this.sourceTranspiled = undefined
}
async load () {
const rawSource = this.sources.source || readFileSync(this.path, 'utf8')
const rawSource = this.sources.source || await readFile(this.path, 'utf8')
const rawSourceMap = this.sources.sourceMap ||
// if we find a source-map (either inline, or a .map file) we load
// both the transpiled and original source, both of which are used during
Expand All @@ -53,7 +53,7 @@ module.exports = class V8ToIstanbul {
if (this.sources.originalSource) {
originalRawSource = this.sources.originalSource
} else {
originalRawSource = readFileSync(this.path, 'utf8')
originalRawSource = await readFile(this.path, 'utf8')
}

this.source = new CovSource(originalRawSource, this.wrapperLength)
Expand Down

0 comments on commit 552b897

Please sign in to comment.