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 {
323323 result = getAsClassComponent ( ) .getAnInstanceMember ( )
324324 }
325325
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 ( ) }
330333
331334 pragma [ noinline]
332335 private DataFlow:: PropWrite getAPropertyValueWrite ( string name ) {
333336 result = getData ( ) .getALocalSource ( ) .getAPropertyWrite ( name )
334337 or
335- result = getASelfRef ( ) .getAPropertyWrite ( name )
338+ result = getAnInstanceRef ( ) .getAPropertyWrite ( name )
336339 }
337340
338341 /**
@@ -548,7 +551,7 @@ module Vue {
548551
549552 pragma [ nomagic]
550553 private DataFlow:: Node propStepSucc ( Component comp , string name ) {
551- result = comp .getASelfRef ( ) .getAPropertyRead ( name )
554+ result = comp .getAnInstanceRef ( ) .getAPropertyRead ( name )
552555 }
553556
554557 /**
You can’t perform that action at this time.
0 commit comments