mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Simplify getABoundFunction
This commit is contained in:
@@ -298,30 +298,6 @@ module Vue {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a node for a member of the `methods` option of this component.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
private DataFlow::SourceNode getAMethod() {
|
||||
result = getMethods().getAPropertySource()
|
||||
or
|
||||
result = getAsClassComponent().getAnInstanceMethod() and
|
||||
not result = getAsClassComponent().getInstanceMethod([lifecycleHookName(), "render", "data"])
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a node for a member of the `computed` option of this component that matches `kind`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
private DataFlow::SourceNode getAnAccessor(DataFlow::MemberKind kind) {
|
||||
result = getComputed().getAPropertySource() and kind = DataFlow::MemberKind::getter()
|
||||
or
|
||||
result = getComputed().getAPropertySource().getAPropertySource(memberKindVerb(kind))
|
||||
or
|
||||
result = getAsClassComponent().getAnInstanceMember(kind) and
|
||||
kind.isAccessor()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a node for a member `name` of the `computed` option of this component that matches `kind`.
|
||||
*/
|
||||
@@ -351,15 +327,9 @@ module Vue {
|
||||
* Gets a node for a function that will be invoked with `this` bound to this component.
|
||||
*/
|
||||
DataFlow::FunctionNode getABoundFunction() {
|
||||
result = getAMethod()
|
||||
result = getOptions().getAMember+().getAValueReachingRhs()
|
||||
or
|
||||
result = getAnAccessor(_)
|
||||
or
|
||||
result = getALifecycleHook(_)
|
||||
or
|
||||
result = getOptionSource(_)
|
||||
or
|
||||
result = getOptionSource(_).getAPropertySource()
|
||||
result = getAsClassComponent().getAnInstanceMember()
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
|
||||
Reference in New Issue
Block a user