File tree 3 files changed +9
-9
lines changed
packages/happy-dom/src/nodes
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export default abstract class CharacterData extends Node implements ICharacterDa
64
64
// MutationObserver
65
65
if ( this [ PropertySymbol . observers ] . length > 0 ) {
66
66
for ( const observer of this [ PropertySymbol . observers ] ) {
67
- if ( observer . options . characterData ) {
67
+ if ( observer . options ? .characterData ) {
68
68
observer . report (
69
69
new MutationRecord ( {
70
70
target : this ,
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export default class ElementNamedNodeMap extends NamedNodeMap {
116
116
this [ PropertySymbol . ownerElement ] [ PropertySymbol . observers ]
117
117
) ) {
118
118
if (
119
- observer . options . attributes &&
119
+ observer . options ? .attributes &&
120
120
( ! observer . options . attributeFilter ||
121
121
observer . options . attributeFilter . includes ( item [ PropertySymbol . name ] ) )
122
122
) {
@@ -199,7 +199,7 @@ export default class ElementNamedNodeMap extends NamedNodeMap {
199
199
this [ PropertySymbol . ownerElement ] [ PropertySymbol . observers ]
200
200
) ) {
201
201
if (
202
- observer . options . attributes &&
202
+ observer . options ? .attributes &&
203
203
( ! observer . options . attributeFilter ||
204
204
observer . options . attributeFilter . includes ( removedItem [ PropertySymbol . name ] ) )
205
205
) {
Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ export default class NodeUtility {
81
81
} ) ;
82
82
83
83
for ( const observer of ( < Node > ancestorNode ) [ PropertySymbol . observers ] ) {
84
- if ( observer . options . subtree ) {
84
+ if ( observer . options ? .subtree ) {
85
85
( < Node > node ) [ PropertySymbol . observe ] ( observer ) ;
86
86
}
87
- if ( observer . options . childList ) {
87
+ if ( observer . options ? .childList ) {
88
88
observer . report ( record ) ;
89
89
}
90
90
}
@@ -124,10 +124,10 @@ export default class NodeUtility {
124
124
} ) ;
125
125
126
126
for ( const observer of ( < Node > ancestorNode ) [ PropertySymbol . observers ] ) {
127
- if ( observer . options . subtree ) {
127
+ if ( observer . options ? .subtree ) {
128
128
( < Node > node ) [ PropertySymbol . unobserve ] ( observer ) ;
129
129
}
130
- if ( observer . options . childList ) {
130
+ if ( observer . options ? .childList ) {
131
131
observer . report ( record ) ;
132
132
}
133
133
}
@@ -214,10 +214,10 @@ export default class NodeUtility {
214
214
} ) ;
215
215
216
216
for ( const observer of ( < Node > ancestorNode ) [ PropertySymbol . observers ] ) {
217
- if ( observer . options . subtree ) {
217
+ if ( observer . options ? .subtree ) {
218
218
( < Node > newNode ) [ PropertySymbol . observe ] ( observer ) ;
219
219
}
220
- if ( observer . options . childList ) {
220
+ if ( observer . options ? .childList ) {
221
221
observer . report ( record ) ;
222
222
}
223
223
}
You can’t perform that action at this time.
0 commit comments