JS: Migrate AngularJS.JQLiteObject

This commit is contained in:
Asger F
2019-08-27 18:07:41 +01:00
parent afdcb1e075
commit a224186fab
2 changed files with 11 additions and 6 deletions

View File

@@ -631,11 +631,11 @@ private class RouteParamSource extends RemoteFlowSource {
* AngularJS expose a jQuery-like interface through `angular.html(..)`.
* The interface may be backed by an actual jQuery implementation.
*/
private class JQLiteObject extends JQueryObject {
private class JQLiteObject extends JQuery::ObjectSource::Range {
JQLiteObject() {
this = angular().getAMemberCall("element").asExpr()
this = angular().getAMemberCall("element")
or
exists(SimpleParameter param |
exists(Parameter param | this = DataFlow::parameterNode(param) |
// element parameters to user-functions invoked by AngularJS
param = any(LinkFunction link).getElementParameter()
or
@@ -652,15 +652,13 @@ private class JQLiteObject extends JQueryObject {
param = f.getAstNode().(Function).getParameter(i)
)
)
|
this = param.getAnInitialUse()
)
or
exists(ServiceReference element |
element.getName() = "$rootElement" or
element.getName() = "$document"
|
this = element.getAnAccess()
this = element.getAReference()
)
}
}

View File

@@ -34,6 +34,13 @@ abstract class ServiceReference extends TServiceReference {
*/
abstract string getName();
/**
* Gets a data flow node that may refer to this service.
*/
DataFlow::SourceNode getAReference() {
result = DataFlow::parameterNode(any(ServiceRequest request).getDependencyParameter(this))
}
/**
* Gets an access to the referenced service.
*/