You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
So far we have looked for the function name $. Are there other ways of calling the jQuery $ function? Perhaps the CodeQL library can handle these for us?
The CodeQL standard library for JavaScript has a built-in predicate jquery() to describe references to $.
Calling the predicate jquery() returns all values that refer to the $ function, and chaining this call with getACall(), will give you all calls to this function.
The text was updated successfully, but these errors were encountered:
Use this library to rewrite your previous query, that gets you all the first argument to a call to $. Use a new file dollar-arg-node.ql.
Notice that when you call jquery(), getACall(), and getArgument() in succession, you get return values of type DataFlow::Node, and not Expr as in your previous query, so you have to change your return variable to have this type.
📖 The DataFlow::Node type
These data flow nodes describe a part of the source program that may have a value, and let us do more complex reasoning about this value. We'll learn more about these in the next section.
You new query should give you the same results as the previous one. Submit your solution in the new file dollar-arg-node.ql when you're happy with it.
Step 5: Using the jQuery library
So far we have looked for the function name
$
. Are there other ways of calling the jQuery$
function? Perhaps the CodeQL library can handle these for us?The CodeQL standard library for JavaScript has a built-in predicate
jquery()
to describe references to$
.Calling the predicate
jquery()
returns all values that refer to the$
function, and chaining this call withgetACall()
, will give you all calls to this function.The text was updated successfully, but these errors were encountered: