mirror of
https://github.com/github/codeql.git
synced 2026-03-30 20:28:15 +02:00
JS: Emit variable bindings for 'this' expressions
This commit is contained in:
@@ -1896,6 +1896,15 @@ public class ASTExtractor {
|
||||
return visit((ThisExpression) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Label visit(ThisExpression nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
if (c.idcontext == IdContext.VAR_BIND || c.idcontext == IdContext.VAR_IN_TYPE_BIND) {
|
||||
addVariableBinding("bind", key, "this");
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Label visit(JSXMemberExpression nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
|
||||
@@ -453,7 +453,7 @@ is_arguments_object (int id: @variable ref);
|
||||
|
||||
@lexical_name = @variable | @local_type_name | @local_namespace_name;
|
||||
|
||||
@bind_id = @varaccess | @local_var_type_access;
|
||||
@bind_id = @varaccess | @local_var_type_access | @this_expr;
|
||||
bind (unique int id: @bind_id ref,
|
||||
int decl: @variable ref);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user