File tree Expand file tree Collapse file tree
src/core/compiler/shadow_dom_emulation
test/core/compiler/shadow_dom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ export class LightDom {
105105
106106 var viewInj = this . lightDomView . elementInjectors ;
107107 this . roots = ListWrapper . map ( this . nodes , ( n ) =>
108- new _Root ( n , ListWrapper . find ( viewInj , ( inj ) => inj . forElement ( n ) ) ) ) ;
108+ new _Root ( n , ListWrapper . find ( viewInj ,
109+ ( inj ) => isPresent ( inj ) ? inj . forElement ( n ) : false ) ) ) ;
109110
110111 return this . roots ;
111112 }
Original file line number Diff line number Diff line change @@ -180,6 +180,19 @@ export function main() {
180180
181181 expect ( toHtml ( lightDom . expandedDomNodes ( ) ) ) . toEqual ( [ "<a></a>" ] ) ;
182182 } ) ;
183+
184+ it ( "should work when the element injector array contains nulls" , ( ) => {
185+ var lightDomEl = el ( "<div><a></a></div>" )
186+
187+ var lightDomView = new FakeView ( [ null ] ) ;
188+
189+ var lightDom = new LightDom (
190+ lightDomView ,
191+ new FakeView ( ) ,
192+ lightDomEl ) ;
193+
194+ expect ( toHtml ( lightDom . expandedDomNodes ( ) ) ) . toEqual ( [ "<a></a>" ] ) ;
195+ } ) ;
183196 } ) ;
184197
185198 describe ( "redistribute" , ( ) => {
You can’t perform that action at this time.
0 commit comments