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 <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
  • Loading branch information
MoLow authored and marco-ippolito committed May 2, 2024
1 parent 161341a commit 9326c5b
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,
};
Loading

0 comments on commit 9326c5b

Please sign in to comment.