File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
modules/angular2/src/core/compiler Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -79,15 +79,15 @@ export class RuntimeMetadataResolver {
7979 `Unexpected directive value '${ stringify ( directives [ i ] ) } ' on the View of component '${ stringify ( component ) } '` ) ;
8080 }
8181 }
82- return removeDuplicatedDirectives ( directives . map ( type => this . getMetadata ( type ) ) ) ;
82+
83+ return removeDuplicates ( directives ) . map ( type => this . getMetadata ( type ) ) ;
8384 }
8485}
8586
86- function removeDuplicatedDirectives ( directives : cpl . CompileDirectiveMetadata [ ] ) :
87- cpl . CompileDirectiveMetadata [ ] {
88- var directivesMap = new Map < Type , cpl . CompileDirectiveMetadata > ( ) ;
89- directives . forEach ( ( dirMeta ) => { directivesMap . set ( dirMeta . type . runtime , dirMeta ) ; } ) ;
90- return MapWrapper . values ( directivesMap ) ;
87+ function removeDuplicates ( items : any [ ] ) : any [ ] {
88+ let m = new Map < any , any > ( ) ;
89+ items . forEach ( i => m . set ( i , null ) ) ;
90+ return MapWrapper . keys ( m ) ;
9191}
9292
9393function flattenDirectives ( view : ViewMetadata ) : Type [ ] {
You can’t perform that action at this time.
0 commit comments