Skip to content

Commit fb744a6

Browse files
author
Max Schaefer
committed
JavaScript: Introduce Parameter.getVariable().
1 parent 2cb33f6 commit fb744a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

javascript/ql/src/semmle/javascript/Variables.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class ArgumentsVariable extends Variable {
217217
/** An identifier that refers to a variable, either in a declaration or in a variable access. */
218218
class VarRef extends @varref, Identifier, BindingPattern, LexicalRef {
219219
/** Gets the variable this identifier refers to. */
220-
Variable getVariable() { none() } // Overriden in VarAccess and VarDecl
220+
override Variable getVariable() { none() } // Overriden in VarAccess and VarDecl
221221

222222
override string getName() { result = Identifier.super.getName() }
223223

@@ -316,6 +316,9 @@ class BindingPattern extends @pattern, Expr {
316316
/** Gets the name of this binding pattern if it is an identifier. */
317317
string getName() { none() }
318318

319+
/** Gets the variable this binding pattern refers to if it is an identifier. */
320+
Variable getVariable() { none() }
321+
319322
/** Gets a variable reference in binding position within this pattern. */
320323
VarRef getABindingVarRef() { none() }
321324

0 commit comments

Comments
 (0)