@@ -230,46 +230,11 @@ module Angular2 {
230230 DomAdapterLocation ( ) { this = domAdapter ( ) .getAMethodCall ( "getLocation" ) }
231231 }
232232
233- /**
234- * A reference to a pipe function, occurring in an Angular pipe expression
235- * that has been desugared to a function call.
236- *
237- * For example, the expression `x | f: y` is desugared to `f(x, y)` where
238- * `f` is a `PipeRefExpr`.
239- */
240- class PipeRefExpr extends Expr , @template_pipe_ref {
241- /** Gets the identifier node naming the pipe. */
242- Identifier getIdentifier ( ) { result = getChildExpr ( 0 ) }
243-
244- /** Gets the name of the pipe being referenced. */
245- string getName ( ) { result = getIdentifier ( ) .getName ( ) }
246-
247- override string getAPrimaryQlClass ( ) { result = "Angular2::PipeRefExpr" }
248- }
233+ class PipeRefExpr = Templating:: PipeRefExpr ;
249234
250- /**
251- * A reference to a variable in a template expression, corresponding
252- * to a property on the component class.
253- */
254- class TemplateVarRefExpr extends Expr {
255- TemplateVarRefExpr ( ) { this = any ( TemplateTopLevel tl ) .getScope ( ) .getAVariable ( ) .getAnAccess ( ) }
256- }
235+ class TemplateVarRefExpr = Templating:: TemplateVarRefExpr ;
257236
258- /** The top-level containing an Angular expression. */
259- class TemplateTopLevel extends TopLevel , @template_toplevel {
260- /** Gets the expression in this top-level. */
261- Expr getExpression ( ) { result = getChildStmt ( 0 ) .( ExprStmt ) .getExpr ( ) }
262-
263- /** Gets the data flow node representing the initialization of the given variable in this scope. */
264- DataFlow:: Node getVariableInit ( string name ) {
265- result = DataFlow:: ssaDefinitionNode ( SSA:: implicitInit ( getScope ( ) .getVariable ( name ) ) )
266- }
267-
268- /** Gets a data flow node corresponding to a use of the given template variable within this top-level. */
269- DataFlow:: SourceNode getAVariableUse ( string name ) {
270- result = getScope ( ) .getVariable ( name ) .getAnAccess ( ) .flow ( )
271- }
272- }
237+ class TemplateTopLevel = Templating:: TemplateTopLevel ;
273238
274239 /** The RHS of a `templateUrl` property, seen as a path expression. */
275240 private class TemplateUrlPath extends PathExpr {
@@ -493,19 +458,10 @@ module Angular2 {
493458 }
494459 }
495460
496- /**
497- * Gets an invocation of the pipe of the given name.
498- *
499- * For example, the call generated from `items | async` would be found by `getAPipeCall("async")`.
500- */
501- DataFlow:: CallNode getAPipeCall ( string name ) {
502- result .getCalleeNode ( ) .asExpr ( ) .( PipeRefExpr ) .getName ( ) = name
503- }
504-
505461 private class BuiltinPipeStep extends TaintTracking:: SharedTaintStep {
506462 override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
507463 exists ( DataFlow:: CallNode call , string name |
508- call = getAPipeCall ( name ) and
464+ call = Templating :: getAPipeCall ( name ) and
509465 succ = call
510466 |
511467 exists ( int i | pred = call .getArgument ( i ) |
0 commit comments