Skip to content

Commit 4c3c712

Browse files
Connormihapedrottimark
authored andcommitted
[expect] optimize compare nodes (#8368)
* [expect] optimize compare nodes 🎨 * Remove needless varible * Update CHANGELOG.md
1 parent 8b6464d commit 4c3c712

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- `[docs]` Mention Jest MongoDB Preset ([#8318](https://github.com/facebook/jest/pull/8318))
3131
- `[@jest/reporters]` Migrate away from `istanbul-api` ([#8294](https://github.com/facebook/jest/pull/8294))
3232
- `[*]` Delete obsolete emails tag from header comment in test files ([#8377](https://github.com/facebook/jest/pull/8377))
33+
- `[expect]` optimize compare nodes ([#8368](https://github.com/facebook/jest/pull/8368))
3334

3435
### Performance
3536

packages/expect/src/jasmineUtils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,8 @@ function eq(
126126
return false;
127127
}
128128

129-
var aIsDomNode = isDomNode(a);
130-
var bIsDomNode = isDomNode(b);
131129
// Use DOM3 method isEqualNode (IE>=9)
132-
if (aIsDomNode && typeof a.isEqualNode === 'function' && bIsDomNode) {
130+
if (isDomNode(a) && isDomNode(b)) {
133131
return a.isEqualNode(b);
134132
}
135133

0 commit comments

Comments
 (0)