Skip to content

Commit

Permalink
fix: compatibility with babel 7 (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez authored and bcoe committed Feb 13, 2018
1 parent b12a07e commit 6cac849
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/istanbul-lib-instrument/src/read-coverage.js
Expand Up @@ -29,7 +29,7 @@ export default function readInitialCoverage (code) {
if (!magicValue.confident || magicValue.value !== MAGIC_VALUE) {
return;
}
covScope = path.scope.getFunctionParent();
covScope = path.scope.getFunctionParent() || path.scope.getProgramParent();
path.stop();
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-lib-instrument/src/visitor.js
Expand Up @@ -544,7 +544,7 @@ function programVisitor(types, sourceFilePath = 'unknown.js', opts = {coverageVa
INITIAL: coverageNode,
HASH: T.stringLiteral(hash)
});
cv._blockHoist = 3;
cv._blockHoist = 5;
path.node.body.unshift(cv);
return {
fileCoverage: coverageData,
Expand Down

0 comments on commit 6cac849

Please sign in to comment.