aboutsummaryrefslogtreecommitdiff
path: root/node_modules/istanbul-lib-instrument/dist
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-10-14 18:40:54 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-10-14 18:40:54 +0200
commit9df98e65f842cf3acae09cbdd969966f42d64469 (patch)
treef071d3e09a342c208fb8e1cd3f5241d64fbfbaf3 /node_modules/istanbul-lib-instrument/dist
parent008926b18470e7f394cd640302957b29728a9803 (diff)
update dependencies
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]));