Skip to content

Commit 814fa1a

Browse files
authored
test_runner: use source maps when reporting coverage
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>
1 parent 6ad5353 commit 814fa1a

File tree

11 files changed

+300
-118
lines changed

11 files changed

+300
-118
lines changed

lib/internal/source_map/source_map.js

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const {
7373
ArrayPrototypeSort,
7474
ObjectPrototypeHasOwnProperty,
7575
StringPrototypeCharAt,
76+
Symbol,
7677
} = primordials;
7778

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

87+
const kMappings = Symbol('kMappings');
88+
8689
class StringCharIterator {
8790
/**
8891
* @constructor
@@ -153,6 +156,10 @@ class SourceMap {
153156
return cloneSourceMapV3(this.#payload);
154157
}
155158

159+
get [kMappings]() {
160+
return this.#mappings;
161+
}
162+
156163
/**
157164
* @return {number[] | undefined} line lengths of generated source code
158165
*/
@@ -382,5 +389,6 @@ function compareSourceMapEntry(entry1, entry2) {
382389
}
383390

384391
module.exports = {
392+
kMappings,
385393
SourceMap,
386394
};

0 commit comments

Comments
 (0)