Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b049136

Browse files
committed
JS: Fix bad join order in Vue model
1 parent d9a5220 commit b049136

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

  • javascript/ql/src/semmle/javascript/frameworks

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,20 +303,19 @@ module Vue {
303303
result = getOptionSource(_).getAPropertySource()
304304
}
305305

306+
pragma[noinline]
307+
private DataFlow::PropWrite getAPropertyValueWrite(string name) {
308+
result = getData().getALocalSource().getAPropertyWrite(name)
309+
or
310+
result = getABoundFunction().getALocalSource().(DataFlow::FunctionNode).getReceiver().getAPropertyWrite(name)
311+
}
312+
306313
/**
307314
* Gets the data flow node that flows into the property `name` of this instance, or is
308315
* returned form a getter defining that property.
309316
*/
310317
DataFlow::Node getAPropertyValue(string name) {
311-
exists(DataFlow::SourceNode obj | obj.getAPropertyWrite(name).getRhs() = result |
312-
obj.flowsTo(getData())
313-
or
314-
exists(DataFlow::FunctionNode bound |
315-
bound.flowsTo(getABoundFunction()) and
316-
not bound.getFunction() instanceof ArrowFunctionExpr and
317-
obj = bound.getReceiver()
318-
)
319-
)
318+
result = getAPropertyValueWrite(name).getRhs()
320319
or
321320
exists(DataFlow::FunctionNode getter |
322321
getter.flowsTo(getAccessor(name, DataFlow::MemberKind::getter())) and

0 commit comments

Comments
 (0)