File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
javascript/ql/lib/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -323,16 +323,19 @@ module Vue {
323
323
result = getAsClassComponent ( ) .getAnInstanceMember ( )
324
324
}
325
325
326
- /**
327
- * Gets a reference to `this` inside the component, referring to an instance of the component.
328
- */
329
- DataFlow:: SourceNode getASelfRef ( ) { result = getABoundFunction ( ) .getReceiver ( ) }
326
+ /** Gets an API node referring to an instance of this component. */
327
+ API:: Node getInstance ( ) {
328
+ result .getAnImmediateUse ( ) = getABoundFunction ( ) .getReceiver ( )
329
+ }
330
+
331
+ /** Gets a data flow node referring to an instance of this component. */
332
+ DataFlow:: SourceNode getAnInstanceRef ( ) { result = getInstance ( ) .getAnImmediateUse ( ) }
330
333
331
334
pragma [ noinline]
332
335
private DataFlow:: PropWrite getAPropertyValueWrite ( string name ) {
333
336
result = getData ( ) .getALocalSource ( ) .getAPropertyWrite ( name )
334
337
or
335
- result = getASelfRef ( ) .getAPropertyWrite ( name )
338
+ result = getAnInstanceRef ( ) .getAPropertyWrite ( name )
336
339
}
337
340
338
341
/**
@@ -548,7 +551,7 @@ module Vue {
548
551
549
552
pragma [ nomagic]
550
553
private DataFlow:: Node propStepSucc ( Component comp , string name ) {
551
- result = comp .getASelfRef ( ) .getAPropertyRead ( name )
554
+ result = comp .getAnInstanceRef ( ) .getAPropertyRead ( name )
552
555
}
553
556
554
557
/**
You can’t perform that action at this time.
0 commit comments