保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 9bdb95c9e34cef640534e5e5a1e2225a80442000
PAMapp/node_modules/v8-to-istanbul/lib/source.js
@@ -1,9 +1,10 @@
const CovLine = require('./line')
const { sliceRange } = require('./range')
const { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND } = require('source-map').SourceMapConsumer
module.exports = class CovSource {
  constructor (sourceRaw, wrapperLength) {
    sourceRaw = sourceRaw.trimEnd()
    sourceRaw = sourceRaw ? sourceRaw.trimEnd() : ''
    this.lines = []
    this.eof = sourceRaw.length
    this.shebangLength = getShebangLength(sourceRaw)
@@ -75,9 +76,7 @@
  // given a start column and end column in absolute offsets within
  // a source file (0 - EOF), returns the relative line column positions.
  offsetToOriginalRelative (sourceMap, startCol, endCol) {
    const lines = this.lines.filter((line, i) => {
      return startCol <= line.endCol && endCol >= line.startCol
    })
    const lines = sliceRange(this.lines, startCol, endCol, true)
    if (!lines.length) return {}
    const start = originalPositionTryBoth(
@@ -85,17 +84,16 @@
      lines[0].line,
      Math.max(0, startCol - lines[0].startCol)
    )
    if (!(start && start.source)) {
      return {}
    }
    let end = originalEndPositionFor(
      sourceMap,
      lines[lines.length - 1].line,
      endCol - lines[lines.length - 1].startCol
    )
    if (!(start && end)) {
      return {}
    }
    if (!(start.source && end.source)) {
    if (!(end && end.source)) {
      return {}
    }