escover 3.3.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +5 -0
- package/lib/cli/version.js +0 -1
- package/lib/config.js +0 -1
- package/lib/coverage-file/coverage-file.js +0 -1
- package/lib/coverage-file/lcov.js +0 -1
- package/lib/escover.js +2 -0
- package/lib/exclude.js +0 -1
- package/lib/exit.js +0 -1
- package/lib/instrument/index.js +0 -1
- package/lib/instrument/plugin-mark/argument.js +2 -4
- package/lib/instrument/plugin-mark/arrow.js +1 -3
- package/lib/instrument/plugin-mark/index.js +4 -11
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/lib/cli/version.js
CHANGED
package/lib/config.js
CHANGED
package/lib/escover.js
CHANGED
package/lib/exclude.js
CHANGED
package/lib/exit.js
CHANGED
package/lib/instrument/index.js
CHANGED
|
@@ -4,16 +4,14 @@ const {SequenceExpression} = types;
|
|
|
4
4
|
|
|
5
5
|
export const addMarkToArgument = (path, lineNode) => {
|
|
6
6
|
const {node} = path;
|
|
7
|
-
const {expression} = lineNode;
|
|
8
7
|
|
|
9
8
|
if (!node.argument) {
|
|
10
|
-
node.argument =
|
|
9
|
+
node.argument = lineNode;
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
node.argument = SequenceExpression([
|
|
15
|
-
|
|
14
|
+
lineNode,
|
|
16
15
|
node.argument,
|
|
17
16
|
]);
|
|
18
17
|
};
|
|
19
|
-
|
|
@@ -78,23 +78,20 @@ export const fix = (path, {options}) => {
|
|
|
78
78
|
if (path.isCallExpression() || path.isNewExpression()) {
|
|
79
79
|
const {node} = path;
|
|
80
80
|
|
|
81
|
-
replaceWith(path, SequenceExpression([
|
|
82
|
-
lineNode.expression,
|
|
83
|
-
node,
|
|
84
|
-
]));
|
|
81
|
+
replaceWith(path, SequenceExpression([lineNode, node]));
|
|
85
82
|
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
if (path.parentPath.isLogicalExpression())
|
|
90
87
|
return replaceWith(path, SequenceExpression([
|
|
91
|
-
lineNode
|
|
88
|
+
lineNode,
|
|
92
89
|
path.node,
|
|
93
90
|
]));
|
|
94
91
|
|
|
95
92
|
if (path.isAssignmentPattern() || path.isAssignmentExpression()) {
|
|
96
93
|
replaceWith(path.get('right'), SequenceExpression([
|
|
97
|
-
lineNode
|
|
94
|
+
lineNode,
|
|
98
95
|
node.right,
|
|
99
96
|
]));
|
|
100
97
|
return;
|
|
@@ -116,10 +113,7 @@ export const fix = (path, {options}) => {
|
|
|
116
113
|
if (path.isExpression()) {
|
|
117
114
|
const {node} = path;
|
|
118
115
|
|
|
119
|
-
replaceWith(path, SequenceExpression([
|
|
120
|
-
lineNode.expression,
|
|
121
|
-
node,
|
|
122
|
-
]));
|
|
116
|
+
replaceWith(path, SequenceExpression([lineNode, node]));
|
|
123
117
|
|
|
124
118
|
return;
|
|
125
119
|
}
|
|
@@ -237,4 +231,3 @@ export const traverse = ({push}) => ({
|
|
|
237
231
|
}
|
|
238
232
|
},
|
|
239
233
|
});
|
|
240
|
-
|