istanbul-lib-instrument
Advanced tools
Comparing version 1.3.1 to 1.4.0-candidate.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.4.0"></a> | ||
# [1.4.0](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.3.1...v1.4.0) (2017-01-02) | ||
### Features | ||
* preserve inferred function names ([#38](https://github.com/istanbuljs/istanbul-lib-instrument/issues/38)) ([312666e](https://github.com/istanbuljs/istanbul-lib-instrument/commit/312666e)) | ||
<a name="1.3.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.3.1](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.3.0...v1.3.1) (2016-12-27) |
@@ -187,2 +187,4 @@ 'use strict'; | ||
path.insertBefore(T.expressionStatement(increment)); | ||
} else if ((path.isFunctionExpression() || path.isArrowFunctionExpression()) && T.isVariableDeclarator(path.parentPath)) { | ||
path.parentPath.parentPath.insertBefore(T.expressionStatement(increment)); | ||
} else /* istanbul ignore else: not expected */if (path.isExpression()) { | ||
@@ -214,2 +216,3 @@ path.replaceWith(T.sequenceExpression([increment, path.node])); | ||
var n = path.node; | ||
var dloc = null; | ||
@@ -236,10 +239,3 @@ // get location for declaration | ||
} | ||
if (!n.id) { | ||
var decl = path.find(function (node) { | ||
return node.isVariableDeclarator(); | ||
}); | ||
if (decl) { | ||
n.id = decl.get('id').node; | ||
} | ||
} | ||
var name = path.node.id ? path.node.id.name : path.node.name; | ||
@@ -246,0 +242,0 @@ var index = this.cov.newFunction(name, dloc, path.node.body.loc); |
{ | ||
"name": "istanbul-lib-instrument", | ||
"version": "1.3.1", | ||
"version": "1.4.0-candidate.0", | ||
"description": "Core istanbul API for JS code coverage", | ||
@@ -5,0 +5,0 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
99751
870
1