File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 130
130
connect ( ) {
131
131
if ( isSlot ( this . _target ) ) {
132
132
this . _listenSlots ( [ this . _target ] ) ;
133
- } else {
133
+ } else if ( this . _target . children ) {
134
134
this . _listenSlots ( this . _target . children ) ;
135
135
if ( window . ShadyDOM ) {
136
136
this . _shadyChildrenObserver =
159
159
disconnect ( ) {
160
160
if ( isSlot ( this . _target ) ) {
161
161
this . _unlistenSlots ( [ this . _target ] ) ;
162
- } else {
162
+ } else if ( this . _target . children ) {
163
163
this . _unlistenSlots ( this . _target . children ) ;
164
164
if ( window . ShadyDOM && this . _shadyChildrenObserver ) {
165
165
ShadyDOM . unobserveChildren ( this . _shadyChildrenObserver ) ;
Original file line number Diff line number Diff line change 1039
1039
document . body . removeChild ( host ) ;
1040
1040
} ) ;
1041
1041
1042
+ test ( 'should not fail on node without children' , function ( ) {
1043
+ var recorded ;
1044
+ var el = document ;
1045
+ var observer = new Polymer . FlattenedNodesObserver ( el , function ( info ) {
1046
+ recorded = info ;
1047
+ } ) ;
1048
+ assert . equal ( recorded , null ) ;
1049
+ observer . disconnect ( ) ;
1050
+ } ) ;
1051
+
1042
1052
} ) ;
1043
1053
1044
1054
</ script >
You can’t perform that action at this time.
0 commit comments