Skip to content

Commit 25d5cc7

Browse files
committed
JS: Use entry location instead of whole container
1 parent d9f81b0 commit 25d5cc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class LocalVariable extends Variable {
322322
* Gets the location of a declaration of this variable.
323323
*
324324
* If the variable has multiple declarations, an arbitrary one is used.
325-
* If it has no declaration, the location of its declaring scope is used.
325+
* If it has no declaration, the entry point of its declaring container is used.
326326
*/
327327
Location getLocation() {
328328
result =
@@ -333,7 +333,7 @@ class LocalVariable extends Variable {
333333
)
334334
or
335335
not exists(getADeclaration()) and
336-
result = getDeclaringContainer().getLocation()
336+
result = getDeclaringContainer().getEntry().getLocation()
337337
}
338338
}
339339

0 commit comments

Comments
 (0)