istanbul-lib-instrument
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [4.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@4.0.0...istanbul-lib-instrument@4.0.1) (2020-02-03) | ||
### Bug Fixes | ||
* Always call coverage initialization function ([#524](https://github.com/istanbuljs/istanbuljs/issues/524)) ([c6536c1](https://github.com/istanbuljs/istanbuljs/commit/c6536c14bf0663ca7e0493dd40ea132b05352594)) | ||
# [4.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@4.0.0-alpha.3...istanbul-lib-instrument@4.0.0) (2019-12-20) | ||
@@ -8,0 +19,0 @@ |
@@ -38,3 +38,2 @@ "use strict"; | ||
this.varName = genVar(sourceFilePath); | ||
this.varCalled = false; | ||
this.attrs = {}; | ||
@@ -176,3 +175,2 @@ this.nextIgnore = null; | ||
x => T.memberExpression(x, T.numericLiteral(index), true) : x => x; | ||
this.varCalled = true; | ||
return T.updateExpression('++', wrap(T.memberExpression(T.memberExpression(T.callExpression(T.identifier(this.varName), []), T.identifier(type)), T.numericLiteral(id), true))); | ||
@@ -670,8 +668,5 @@ } | ||
HASH: T.stringLiteral(hash) | ||
}); // explicitly call this.varName if this file has no coverage | ||
}); // explicitly call this.varName to ensure coverage is always initialized | ||
if (!visitState.varCalled) { | ||
path.node.body.unshift(T.expressionStatement(T.callExpression(T.identifier(visitState.varName), []))); | ||
} | ||
path.node.body.unshift(T.expressionStatement(T.callExpression(T.identifier(visitState.varName), []))); | ||
path.node.body.unshift(cv); | ||
@@ -678,0 +673,0 @@ return { |
{ | ||
"name": "istanbul-lib-instrument", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Core istanbul API for JS code coverage", | ||
@@ -56,3 +56,3 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", | ||
}, | ||
"gitHead": "5319df684b508ff6fb19fe8b9a6147a3c5924e4b" | ||
"gitHead": "4eb43e4325471549d2aa880b5ed2ada475265fcf" | ||
} |
57172
913
74
0
0
0
3