Skip to content

Commit 7be4b76

Browse files
committed
JS: Simplify getABoundFunction
1 parent 0ee1e8b commit 7be4b76

File tree

1 file changed

+2
-32
lines changed
  • javascript/ql/lib/semmle/javascript/frameworks

1 file changed

+2
-32
lines changed

javascript/ql/lib/semmle/javascript/frameworks/Vue.qll

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -298,30 +298,6 @@ module Vue {
298298
)
299299
}
300300

301-
/**
302-
* Gets a node for a member of the `methods` option of this component.
303-
*/
304-
pragma[nomagic]
305-
private DataFlow::SourceNode getAMethod() {
306-
result = getMethods().getAPropertySource()
307-
or
308-
result = getAsClassComponent().getAnInstanceMethod() and
309-
not result = getAsClassComponent().getInstanceMethod([lifecycleHookName(), "render", "data"])
310-
}
311-
312-
/**
313-
* Gets a node for a member of the `computed` option of this component that matches `kind`.
314-
*/
315-
pragma[nomagic]
316-
private DataFlow::SourceNode getAnAccessor(DataFlow::MemberKind kind) {
317-
result = getComputed().getAPropertySource() and kind = DataFlow::MemberKind::getter()
318-
or
319-
result = getComputed().getAPropertySource().getAPropertySource(memberKindVerb(kind))
320-
or
321-
result = getAsClassComponent().getAnInstanceMember(kind) and
322-
kind.isAccessor()
323-
}
324-
325301
/**
326302
* Gets a node for a member `name` of the `computed` option of this component that matches `kind`.
327303
*/
@@ -351,15 +327,9 @@ module Vue {
351327
* Gets a node for a function that will be invoked with `this` bound to this component.
352328
*/
353329
DataFlow::FunctionNode getABoundFunction() {
354-
result = getAMethod()
355-
or
356-
result = getAnAccessor(_)
357-
or
358-
result = getALifecycleHook(_)
359-
or
360-
result = getOptionSource(_)
330+
result = getOptions().getAMember+().getAValueReachingRhs()
361331
or
362-
result = getOptionSource(_).getAPropertySource()
332+
result = getAsClassComponent().getAnInstanceMember()
363333
}
364334

365335
pragma[noinline]

0 commit comments

Comments
 (0)