Skip to content

Commit

Permalink
test_runner: use source maps when reporting coverage
Browse files Browse the repository at this point in the history
PR-URL: #52060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
  • Loading branch information
MoLow authored and marco-ippolito committed May 3, 2024
1 parent 5f1e7a0 commit 61e7ae0
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 118 deletions.
8 changes: 8 additions & 0 deletions lib/internal/source_map/source_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const {
ArrayPrototypeSort,
ObjectPrototypeHasOwnProperty,
StringPrototypeCharAt,
Symbol,
} = primordials;

const { validateObject } = require('internal/validators');
Expand All @@ -83,6 +84,8 @@ const VLQ_BASE_SHIFT = 5;
const VLQ_BASE_MASK = (1 << 5) - 1;
const VLQ_CONTINUATION_MASK = 1 << 5;

const kMappings = Symbol('kMappings');

class StringCharIterator {
/**
* @constructor
Expand Down Expand Up @@ -153,6 +156,10 @@ class SourceMap {
return cloneSourceMapV3(this.#payload);
}

get [kMappings]() {
return this.#mappings;
}

/**
* @return {number[] | undefined} line lengths of generated source code
*/
Expand Down Expand Up @@ -382,5 +389,6 @@ function compareSourceMapEntry(entry1, entry2) {
}

module.exports = {
kMappings,
SourceMap,
};

0 comments on commit 61e7ae0

Please sign in to comment.