mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
JS: Use getAParameter and not getReceiver instead of getASuccessor
This commit is contained in:
@@ -162,10 +162,9 @@ module ExternalAPIUsedWithUntrustedData {
|
||||
* Gets a parameter of `base` with name `name`, or a property named `name` of a destructuring parameter.
|
||||
*/
|
||||
private API::Node getNamedParameter(API::Node base, string name) {
|
||||
exists(API::Node param, string lbl |
|
||||
// getParameter(i) requires a bindingset for i, so use the raw label
|
||||
param = base.getASuccessor("parameter " + lbl) and
|
||||
lbl != "-1" // ignore receiver
|
||||
exists(API::Node param |
|
||||
param = base.getAParameter() and
|
||||
not param = base.getReceiver()
|
||||
|
|
||||
result = param and
|
||||
name = param.getAnImmediateUse().asExpr().(Parameter).getName()
|
||||
|
||||
Reference in New Issue
Block a user