Skip to content

Commit b51ba81

Browse files
committed
Added an ignore for edge cases on MO
1 parent 7a0c21e commit b51ba81

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cjs/interface/mutation-observer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ const moCallback = (element, parentNode) => {
7676
for (const [target, {subtree, childList, characterData}] of observer.nodes) {
7777
if (childList) {
7878
if (
79-
(parentNode && (target === parentNode || (subtree && target.contains(parentNode)))) ||
80-
(!parentNode && ((subtree && (target === ownerDocument || target.contains(element))) ||
79+
(parentNode && (target === parentNode || /* c8 ignore next */(subtree && target.contains(parentNode)))) ||
80+
(!parentNode && ((subtree && (target === ownerDocument || /* c8 ignore next */target.contains(element))) ||
8181
(!subtree && target[characterData ? 'childNodes' : 'children'].includes(element))))
8282
) {
8383
const {callback, records, scheduled} = observer;

esm/interface/mutation-observer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export const moCallback = (element, parentNode) => {
7474
for (const [target, {subtree, childList, characterData}] of observer.nodes) {
7575
if (childList) {
7676
if (
77-
(parentNode && (target === parentNode || (subtree && target.contains(parentNode)))) ||
78-
(!parentNode && ((subtree && (target === ownerDocument || target.contains(element))) ||
77+
(parentNode && (target === parentNode || /* c8 ignore next */(subtree && target.contains(parentNode)))) ||
78+
(!parentNode && ((subtree && (target === ownerDocument || /* c8 ignore next */target.contains(element))) ||
7979
(!subtree && target[characterData ? 'childNodes' : 'children'].includes(element))))
8080
) {
8181
const {callback, records, scheduled} = observer;

types/esm/shared/node.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function parentElement({ parentNode }: {
66
parentNode: any;
77
}): any;
88
export function previousSibling({ [PREV]: prev }: {
9-
"__@PREV@22229": any;
9+
"__@PREV@22226": any;
1010
}): any;
1111
export function nextSibling(node: any): any;
1212
import { PREV } from "./symbols.js";

worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,8 +3947,8 @@ const moCallback = (element, parentNode) => {
39473947
for (const [target, {subtree, childList, characterData}] of observer.nodes) {
39483948
if (childList) {
39493949
if (
3950-
(parentNode && (target === parentNode || (subtree && target.contains(parentNode)))) ||
3951-
(!parentNode && ((subtree && (target === ownerDocument || target.contains(element))) ||
3950+
(parentNode && (target === parentNode || /* c8 ignore next */(subtree && target.contains(parentNode)))) ||
3951+
(!parentNode && ((subtree && (target === ownerDocument || /* c8 ignore next */target.contains(element))) ||
39523952
(!subtree && target[characterData ? 'childNodes' : 'children'].includes(element))))
39533953
) {
39543954
const {callback, records, scheduled} = observer;

0 commit comments

Comments
 (0)