escover 1.14.0 → 1.15.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 +6 -0
- package/lib/instrument/plugin-mark/index.js +19 -5
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -63,6 +63,12 @@ export const fix = (path, {options}) => {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
if (path.parentPath.isLogicalExpression())
|
|
67
|
+
return replaceWith(path, SequenceExpression([
|
|
68
|
+
lineNode.expression,
|
|
69
|
+
path.node,
|
|
70
|
+
]));
|
|
71
|
+
/*
|
|
66
72
|
if (path.isLogicalExpression()) {
|
|
67
73
|
replaceWith(path.get('left'), SequenceExpression([
|
|
68
74
|
lineNode.expression,
|
|
@@ -74,6 +80,7 @@ export const fix = (path, {options}) => {
|
|
|
74
80
|
]));
|
|
75
81
|
return;
|
|
76
82
|
}
|
|
83
|
+
*/
|
|
77
84
|
|
|
78
85
|
if (path.isAssignmentPattern() || path.isAssignmentExpression()) {
|
|
79
86
|
replaceWith(path.get('right'), SequenceExpression([
|
|
@@ -110,10 +117,13 @@ const EXCLUDE = [
|
|
|
110
117
|
|
|
111
118
|
const SEQUENCE = `(${LINE}, __z)`;
|
|
112
119
|
const isExclude = (node) => {
|
|
113
|
-
|
|
120
|
+
const templates = [
|
|
114
121
|
...EXCLUDE,
|
|
115
122
|
SEQUENCE,
|
|
116
|
-
]
|
|
123
|
+
];
|
|
124
|
+
return compareAny(node, templates, {
|
|
125
|
+
findUp: false,
|
|
126
|
+
});
|
|
117
127
|
};
|
|
118
128
|
|
|
119
129
|
export const exclude = () => EXCLUDE;
|
|
@@ -153,10 +163,14 @@ export const traverse = ({push}) => ({
|
|
|
153
163
|
push(path);
|
|
154
164
|
},
|
|
155
165
|
LogicalExpression(path) {
|
|
156
|
-
|
|
157
|
-
|
|
166
|
+
const leftPath = path.get('left');
|
|
167
|
+
const rightPath = path.get('right');
|
|
158
168
|
|
|
159
|
-
|
|
169
|
+
if (!isExclude(leftPath))
|
|
170
|
+
push(leftPath);
|
|
171
|
+
|
|
172
|
+
if (!isExclude(rightPath))
|
|
173
|
+
push(rightPath);
|
|
160
174
|
},
|
|
161
175
|
BlockStatement(path) {
|
|
162
176
|
if (path.node.body.length)
|