diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-16 01:59:39 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-16 02:00:31 +0100 |
commit | bd65bb67e25a79b019d745b7262b2008ce2adb15 (patch) | |
tree | 89e1b032103a63737f1a703e6a943832ef261704 /node_modules/istanbul-lib-instrument/dist/instrumenter.js | |
parent | f91466595b651721690133f58ab37f977539e95b (diff) |
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/istanbul-lib-instrument/dist/instrumenter.js')
-rw-r--r-- | node_modules/istanbul-lib-instrument/dist/instrumenter.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/node_modules/istanbul-lib-instrument/dist/instrumenter.js b/node_modules/istanbul-lib-instrument/dist/instrumenter.js index 1307bfd8a..5c4e197c9 100644 --- a/node_modules/istanbul-lib-instrument/dist/instrumenter.js +++ b/node_modules/istanbul-lib-instrument/dist/instrumenter.js @@ -104,12 +104,15 @@ var Instrumenter = function () { * * @param {string} code - the code to instrument * @param {string} filename - the filename against which to track coverage. + * @param {object} [inputSourceMap] - the source map that maps the not instrumented code back to it's original form. + * Is assigned to the coverage object and therefore, is available in the json output and can be used to remap the + * coverage to the untranspiled source. * @returns {string} the instrumented code. */ }, { key: 'instrumentSync', - value: function instrumentSync(code, filename) { + value: function instrumentSync(code, filename, inputSourceMap) { if (typeof code !== 'string') { throw new Error('Code must be a string'); } @@ -120,7 +123,8 @@ var Instrumenter = function () { sourceType: opts.esModules ? "module" : "script" }); var ee = (0, _visitor2.default)(t, filename, { - coverageVariable: opts.coverageVariable + coverageVariable: opts.coverageVariable, + inputSourceMap: inputSourceMap }); var output = {}; var visitor = { @@ -155,17 +159,20 @@ var Instrumenter = function () { * @param {string} code - the code to instrument * @param {string} filename - the filename against which to track coverage. * @param {Function} callback - the callback + * @param {Object} inputSourceMap - the source map that maps the not instrumented code back to it's original form. + * Is assigned to the coverage object and therefore, is available in the json output and can be used to remap the + * coverage to the untranspiled source. */ }, { key: 'instrument', - value: function instrument(code, filename, callback) { + value: function instrument(code, filename, callback, inputSourceMap) { if (!callback && typeof filename === 'function') { callback = filename; filename = null; } try { - var out = this.instrumentSync(code, filename); + var out = this.instrumentSync(code, filename, inputSourceMap); callback(null, out); } catch (ex) { callback(ex); |