@@ -77,46 +77,61 @@ module Angular2 {
7777 }
7878
7979 /** Gets a reference to a `ParamMap` object, usually containing values from the URL. */
80- DataFlow:: SourceNode paramMap ( ) {
81- result .hasUnderlyingType ( "@angular/router" , "ParamMap" )
80+ private DataFlow:: SourceNode paramMap ( ClientSideRemoteFlowKind kind ) {
81+ result .hasUnderlyingType ( "@angular/router" , "ParamMap" ) and kind . isPath ( )
8282 or
83- result = activatedRouteProp ( [ "paramMap" , "queryParamMap" ] )
83+ result = activatedRouteProp ( "paramMap" ) and kind . isPath ( )
8484 or
85- result = urlSegment ( ) .getAPropertyRead ( "parameterMap" )
85+ result = activatedRouteProp ( "queryParamMap" ) and kind .isQuery ( )
86+ or
87+ result = urlSegment ( ) .getAPropertyRead ( "parameterMap" ) and kind .isPath ( )
8688 }
8789
90+ /** Gets a reference to a `ParamMap` object, usually containing values from the URL. */
91+ DataFlow:: SourceNode paramMap ( ) { result = paramMap ( _) }
92+
8893 /** Gets a reference to a `Params` object, usually containing values from the URL. */
89- DataFlow:: SourceNode paramDictionaryObject ( ) {
94+ private DataFlow:: SourceNode paramDictionaryObject ( ClientSideRemoteFlowKind kind ) {
9095 result .hasUnderlyingType ( "@angular/router" , "Params" ) and
96+ kind .isPath ( ) and
9197 not result instanceof DataFlow:: ObjectLiteralNode // ignore object literals found by contextual typing
9298 or
93- result = activatedRouteProp ( [ "params" , "queryParams" ] )
99+ result = activatedRouteProp ( "params" ) and kind .isPath ( )
100+ or
101+ result = activatedRouteProp ( "queryParams" ) and kind .isQuery ( )
94102 or
95- result = paramMap ( ) .getAPropertyRead ( "params" )
103+ result = paramMap ( kind ) .getAPropertyRead ( "params" )
96104 or
97- result = urlSegment ( ) .getAPropertyRead ( "parameters" )
105+ result = urlSegment ( ) .getAPropertyRead ( "parameters" ) and kind . isPath ( )
98106 }
99107
108+ /** Gets a reference to a `Params` object, usually containing values from the URL. */
109+ DataFlow:: SourceNode paramDictionaryObject ( ) { result = paramDictionaryObject ( _) }
110+
100111 /**
101112 * A value from `@angular/router` derived from the URL.
102113 */
103- class AngularSource extends RemoteFlowSource {
114+ class AngularSource extends ClientSideRemoteFlowSource {
115+ ClientSideRemoteFlowKind kind ;
116+
104117 AngularSource ( ) {
105- this = paramMap ( ) .getAMethodCall ( [ "get" , "getAll" ] )
118+ this = paramMap ( kind ) .getAMethodCall ( [ "get" , "getAll" ] )
106119 or
107- this = paramDictionaryObject ( )
120+ this = paramDictionaryObject ( kind )
108121 or
109- this = activatedRouteProp ( "fragment" )
122+ this = activatedRouteProp ( "fragment" ) and kind . isFragment ( )
110123 or
111- this = urlSegment ( ) .getAPropertyRead ( "path" )
124+ this = urlSegment ( ) .getAPropertyRead ( "path" ) and kind . isPath ( )
112125 or
113126 // Note that Router.url and RouterStateSnapshot.url are strings, not UrlSegment[]
114- this = router ( ) .getAPropertyRead ( "url" )
127+ this = router ( ) .getAPropertyRead ( "url" ) and kind . isUrl ( )
115128 or
116- this = routerStateSnapshot ( ) .getAPropertyRead ( "url" )
129+ this = routerStateSnapshot ( ) .getAPropertyRead ( "url" ) and kind . isUrl ( )
117130 }
118131
119132 override string getSourceType ( ) { result = "Angular route parameter" }
133+
134+ override ClientSideRemoteFlowKind getKind ( ) { result = kind }
120135 }
121136
122137 /** Gets a reference to a `DomSanitizer` object. */
0 commit comments