File tree 1 file changed +9
-11
lines changed
javascript/ql/lib/semmle/javascript/frameworks
1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ private import semmle.javascript.security.dataflow.ClientSideUrlRedirectCustomiz
9
9
private import semmle.javascript.DynamicPropertyAccess
10
10
private import semmle.javascript.dataflow.internal.PreCallGraphStep
11
11
private import semmle.javascript.ViewComponentInput
12
+ private import semmle.javascript.internal.paths.PathExprResolver
12
13
13
14
/**
14
15
* Provides classes for working with Angular (also known as Angular 2.x) applications.
@@ -240,18 +241,15 @@ module Angular2 {
240
241
241
242
class TemplateTopLevel = Templating:: TemplateTopLevel ;
242
243
243
- /** The RHS of a `templateUrl` property, seen as a path expression. */
244
- private class TemplateUrlPath extends PathExpr {
245
- TemplateUrlPath ( ) {
246
- exists ( Property prop |
247
- prop .getName ( ) = "templateUrl" and
248
- this = prop .getInit ( )
249
- )
250
- }
251
-
252
- override string getValue ( ) { result = this .( Expr ) .getStringValue ( ) }
244
+ private predicate shouldResolveExpr ( Expr e ) {
245
+ exists ( Property prop |
246
+ prop .getName ( ) = "templateUrl" and
247
+ e = prop .getInit ( )
248
+ )
253
249
}
254
250
251
+ private module Resolver = ResolveExpr< shouldResolveExpr / 1 > ;
252
+
255
253
/**
256
254
* Holds if the value of `attrib` is interpreted as an Angular expression.
257
255
*/
@@ -338,7 +336,7 @@ module Angular2 {
338
336
*/
339
337
pragma [ noinline]
340
338
File getTemplateFile ( ) {
341
- result = decorator .getOptionArgument ( 0 , "templateUrl" ) .asExpr ( ) . ( PathExpr ) . resolve ( )
339
+ result = Resolver :: resolveExpr ( decorator .getOptionArgument ( 0 , "templateUrl" ) .asExpr ( ) )
342
340
}
343
341
344
342
/** Gets an element in the HTML template of this component. */
You can’t perform that action at this time.
0 commit comments