istanbul-lib-instrument
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.4.2"></a> | ||
## [1.4.2](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.4.1...v1.4.2) (2017-01-04) | ||
### Bug Fixes | ||
* only hoist counter for a smaller subset of function declarations ([9f8931e](https://github.com/istanbuljs/istanbul-lib-instrument/commit/9f8931e)) | ||
<a name="1.4.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.4.1](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.4.0...v1.4.1) (2017-01-04) |
@@ -188,7 +188,9 @@ 'use strict'; | ||
} else if ((path.isFunctionExpression() || path.isArrowFunctionExpression()) && T.isVariableDeclarator(path.parentPath)) { | ||
var parent = path.findParent(function (path) { | ||
return path.parentPath.isProgram(); | ||
}); | ||
if (parent) { | ||
// 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))) { | ||
parent.insertBefore(T.expressionStatement(increment)); | ||
} else { | ||
path.replaceWith(T.sequenceExpression([increment, path.node])); | ||
} | ||
@@ -195,0 +197,0 @@ } else /* istanbul ignore else: not expected */if (path.isExpression()) { |
{ | ||
"name": "istanbul-lib-instrument", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Core istanbul API for JS code coverage", | ||
@@ -5,0 +5,0 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101645
877