bcoe / bcoe/c8

Modify coverage ranges for code run in VM

Open
#524 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

* **Version**: v20.8.1
* **Platform**: Linux 6.6.4-arch1-1

I run certain code like this:

```javascript
let head = '(function(module, exports, require, __dirname, __filename, ' + argument_config.names.join(', ') + ') {"use strict";\n';

let exported_function = libvm.runInThisContext(head + source + '\n/**/})', {
filename: path,
lineOffset: -1,
});
```

And contrary to `nyc`, `c8` is able to create coverage for this.
Unfortunately, because of the added header the coverage positions are wrong.

Would it be possible for `c8` to use the `lineOffset` or `columnOffset` property somehow?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.