mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
JS:Add ConstructorThisArgumentNode
This commit is contained in:
@@ -1055,6 +1055,24 @@ module DataFlow {
|
||||
override string toString() { result = "global access path" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A node representing the value passed as `this` argument in a `new` call or a `super` call.
|
||||
*/
|
||||
class ConstructorThisArgumentNode extends TConstructorThisArgumentNode, DataFlow::Node {
|
||||
private InvokeExpr expr;
|
||||
|
||||
ConstructorThisArgumentNode() { this = TConstructorThisArgumentNode(expr) }
|
||||
|
||||
override string toString() { result = "implicit 'this' argument of " + expr }
|
||||
|
||||
override StmtContainer getContainer() { result = expr.getContainer() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
expr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* INTERNAL. DO NOT USE.
|
||||
*
|
||||
|
||||
@@ -34,6 +34,7 @@ private module Cached {
|
||||
TGlobalAccessPathRoot() or
|
||||
TTemplatePlaceholderTag(Templating::TemplatePlaceholderTag tag) or
|
||||
TReflectiveParametersNode(Function f) or
|
||||
TConstructorThisArgumentNode(InvokeExpr e) { e instanceof NewExpr or e instanceof SuperCall } or
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
Reference in New Issue
Block a user