Skip to content

Commit 9566265

Browse files
committed
JS: Add helper for getting local type names
1 parent 4cd6f45 commit 9566265

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

javascript/ql/lib/semmle/javascript/Variables.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ class Scope extends @scope {
2727
result = this.getAVariable() and
2828
result.getName() = name
2929
}
30+
31+
/** Gets the local type name with the given name declared in this scope. */
32+
LocalTypeName getLocalTypeName(string name) {
33+
result.getScope() = this and
34+
result.getName() = name
35+
}
3036
}
3137

3238
/**

0 commit comments

Comments
 (0)