File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
javascript/ql/src/semmle/javascript/frameworks/AngularJS Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -631,11 +631,11 @@ private class RouteParamSource extends RemoteFlowSource {
631631 * AngularJS expose a jQuery-like interface through `angular.html(..)`.
632632 * The interface may be backed by an actual jQuery implementation.
633633 */
634- private class JQLiteObject extends JQueryObject {
634+ private class JQLiteObject extends JQuery :: ObjectSource :: Range {
635635 JQLiteObject ( ) {
636- this = angular ( ) .getAMemberCall ( "element" ) . asExpr ( )
636+ this = angular ( ) .getAMemberCall ( "element" )
637637 or
638- exists ( SimpleParameter param |
638+ exists ( Parameter param | this = DataFlow :: parameterNode ( param ) |
639639 // element parameters to user-functions invoked by AngularJS
640640 param = any ( LinkFunction link ) .getElementParameter ( )
641641 or
@@ -652,15 +652,13 @@ private class JQLiteObject extends JQueryObject {
652652 param = f .getAstNode ( ) .( Function ) .getParameter ( i )
653653 )
654654 )
655- |
656- this = param .getAnInitialUse ( )
657655 )
658656 or
659657 exists ( ServiceReference element |
660658 element .getName ( ) = "$rootElement" or
661659 element .getName ( ) = "$document"
662660 |
663- this = element .getAnAccess ( )
661+ this = element .getAReference ( )
664662 )
665663 }
666664}
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ abstract class ServiceReference extends TServiceReference {
3434 */
3535 abstract string getName ( ) ;
3636
37+ /**
38+ * Gets a data flow node that may refer to this service.
39+ */
40+ DataFlow:: SourceNode getAReference ( ) {
41+ result = DataFlow:: parameterNode ( any ( ServiceRequest request ) .getDependencyParameter ( this ) )
42+ }
43+
3744 /**
3845 * Gets an access to the referenced service.
3946 */
You can’t perform that action at this time.
0 commit comments