aboutsummaryrefslogtreecommitdiff
path: root/node_modules/istanbul-lib-instrument/dist/visitor.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-16 01:59:39 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-16 02:00:31 +0100
commitbd65bb67e25a79b019d745b7262b2008ce2adb15 (patch)
tree89e1b032103a63737f1a703e6a943832ef261704 /node_modules/istanbul-lib-instrument/dist/visitor.js
parentf91466595b651721690133f58ab37f977539e95b (diff)
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/istanbul-lib-instrument/dist/visitor.js')
-rw-r--r--node_modules/istanbul-lib-instrument/dist/visitor.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/node_modules/istanbul-lib-instrument/dist/visitor.js b/node_modules/istanbul-lib-instrument/dist/visitor.js
index 55a616848..cae5146f5 100644
--- a/node_modules/istanbul-lib-instrument/dist/visitor.js
+++ b/node_modules/istanbul-lib-instrument/dist/visitor.js
@@ -36,13 +36,17 @@ function genVar(filename) {
// and is the `this` for the individual coverage visitors.
var VisitState = function () {
- function VisitState(types, sourceFilePath) {
+ function VisitState(types, sourceFilePath, inputSourceMap) {
_classCallCheck(this, VisitState);
this.varName = genVar(sourceFilePath);
this.attrs = {};
this.nextIgnore = null;
this.cov = new _sourceCoverage.SourceCoverage(sourceFilePath);
+
+ if (typeof inputSourceMap !== "undefined") {
+ this.cov.inputSourceMap(inputSourceMap);
+ }
this.types = types;
this.sourceMappingURL = null;
}
@@ -484,13 +488,15 @@ var coverageTemplate = (0, _babelTemplate2.default)('\n var COVERAGE_VAR = (f
* @param {string} sourceFilePath - the path to source file
* @param {Object} opts - additional options
* @param {string} [opts.coverageVariable=__coverage__] the global coverage variable name.
+ * @param {object} [opts.inputSourceMap=undefined] the input source map, that maps the uninstrumented code back to the
+ * original code.
*/
function programVisitor(types) {
var sourceFilePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'unknown.js';
- var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { coverageVariable: '__coverage__' };
+ var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { coverageVariable: '__coverage__', inputSourceMap: undefined };
var T = types;
- var visitState = new VisitState(types, sourceFilePath);
+ var visitState = new VisitState(types, sourceFilePath, opts.inputSourceMap);
return {
enter: function enter(path) {
path.traverse(codeVisitor, visitState);