mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: replace .stripParens library uses w. .getUnderlyingReference
This commit is contained in:
@@ -71,7 +71,7 @@ private predicate defn(ControlFlowNode def, Expr lhs, AST::ValueNode rhs) {
|
||||
private predicate defn(ControlFlowNode def, Expr lhs) {
|
||||
defn(def, lhs, _) or
|
||||
lhs = def.(CompoundAssignExpr).getTarget() or
|
||||
lhs = def.(UpdateExpr).getOperand().stripParens() or
|
||||
lhs = def.(UpdateExpr).getOperand().getUnderlyingReference() or
|
||||
lhs = def.(ImportSpecifier).getLocal() or
|
||||
exists (EnhancedForLoop efl | def = efl.getIteratorExpr() |
|
||||
lhs = def.(Expr).stripParens() or
|
||||
@@ -143,7 +143,7 @@ class RValue extends RefExpr {
|
||||
not this instanceof LValue and not this instanceof VarDecl or
|
||||
// in `x++` and `x += 1`, `x` is both RValue and LValue
|
||||
this = any(CompoundAssignExpr a).getTarget() or
|
||||
this = any(UpdateExpr u).getOperand().stripParens() or
|
||||
this = any(UpdateExpr u).getOperand().getUnderlyingReference() or
|
||||
this = any(NamespaceDeclaration decl).getId()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ class VarAccess extends @varaccess, VarRef, LexicalAccess {
|
||||
|
||||
override predicate isLValue() {
|
||||
exists (Assignment assgn | assgn.getTarget() = this) or
|
||||
exists (UpdateExpr upd | upd.getOperand().stripParens() = this) or
|
||||
exists (UpdateExpr upd | upd.getOperand().getUnderlyingReference() = this) or
|
||||
exists (EnhancedForLoop efl | efl.getIterator() = this) or
|
||||
exists (BindingPattern p | this = p.getABindingVarRef() and p.isLValue())
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ abstract class SourceNode extends DataFlow::Node {
|
||||
*/
|
||||
DataFlow::CallNode getAMethodCall(string methodName) {
|
||||
exists (PropAccess pacc |
|
||||
pacc = result.getCalleeNode().asExpr().stripParens() and
|
||||
pacc = result.getCalleeNode().asExpr().getUnderlyingReference() and
|
||||
flowsToExpr(pacc.getBase()) and
|
||||
pacc.getPropertyName() = methodName
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user