Open github-learning-lab[bot] opened 2 years ago
Take a few minutes to read about the data flow nodes for JavaScript and TypeScript.
DataFlow::FunctionNode
is a data flow node that corresponds to a function (expression or declaration)You have already seen how to find references to the jQuery $
function. Now find all places in the code that read the property $.fn
. These results of your query will be of type DataFlow::Node
.
Notice that jquery()
returns a value of type DataFlow::SourceNode
, from which the flow of data may be tracked. Use the auto-completion feature after jquery().
to browse the predicates of this DataFlow::SourceNode
type, and their documentation. Look for a predicate that gets you all reads of a property named fn
.
Write your query in the file property-read.ql
and submit it.
Step 6: Finding jQuery plugin options
jQuery plugins are usually defined by assigning a value to a property of the
$.fn
object:In the following steps, we'll find such plugins, and their options. We'll find
$.fn
is read$.fn