aboutsummaryrefslogtreecommitdiff
path: root/node_modules/istanbul-lib-instrument/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/istanbul-lib-instrument/dist')
-rw-r--r--node_modules/istanbul-lib-instrument/dist/instrumenter.js2
-rw-r--r--node_modules/istanbul-lib-instrument/dist/visitor.js4
2 files changed, 4 insertions, 2 deletions
diff --git a/node_modules/istanbul-lib-instrument/dist/instrumenter.js b/node_modules/istanbul-lib-instrument/dist/instrumenter.js
index ff64c3afb..313647ccf 100644
--- a/node_modules/istanbul-lib-instrument/dist/instrumenter.js
+++ b/node_modules/istanbul-lib-instrument/dist/instrumenter.js
@@ -121,7 +121,7 @@ var Instrumenter = function () {
var ast = babylon.parse(code, {
allowReturnOutsideFunction: opts.autoWrap,
sourceType: opts.esModules ? "module" : "script",
- plugins: ['asyncGenerators', 'dynamicImport', 'flow', 'jsx']
+ plugins: ['asyncGenerators', 'dynamicImport', 'objectRestSpread', 'flow', 'jsx']
});
var ee = (0, _visitor2.default)(t, filename, {
coverageVariable: opts.coverageVariable,
diff --git a/node_modules/istanbul-lib-instrument/dist/visitor.js b/node_modules/istanbul-lib-instrument/dist/visitor.js
index 3462f9314..edceff7ff 100644
--- a/node_modules/istanbul-lib-instrument/dist/visitor.js
+++ b/node_modules/istanbul-lib-instrument/dist/visitor.js
@@ -197,7 +197,9 @@ var VisitState = function () {
// make an attempt to hoist the statement counter, so that
// function names are maintained.
var parent = path.parentPath.parentPath;
- if (parent && (T.isProgram(parent.parentPath) || T.isBlockStatement(parent.parentPath))) {
+ if (parent && T.isExportNamedDeclaration(parent.parentPath)) {
+ parent.parentPath.insertBefore(T.expressionStatement(increment));
+ } else if (parent && (T.isProgram(parent.parentPath) || T.isBlockStatement(parent.parentPath))) {
parent.insertBefore(T.expressionStatement(increment));
} else {
path.replaceWith(T.sequenceExpression([increment, path.node]));