JS: Use entry location instead of whole container

This commit is contained in:
Asger Feldthaus 2020-04-09 09:18:26 +01:00
Родитель d9f81b082b
Коммит 25d5cc78cb
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -322,7 +322,7 @@ class LocalVariable extends Variable {
* Gets the location of a declaration of this variable. * Gets the location of a declaration of this variable.
* *
* If the variable has multiple declarations, an arbitrary one is used. * If the variable has multiple declarations, an arbitrary one is used.
* If it has no declaration, the location of its declaring scope is used. * If it has no declaration, the entry point of its declaring container is used.
*/ */
Location getLocation() { Location getLocation() {
result = result =
@ -333,7 +333,7 @@ class LocalVariable extends Variable {
) )
or or
not exists(getADeclaration()) and not exists(getADeclaration()) and
result = getDeclaringContainer().getLocation() result = getDeclaringContainer().getEntry().getLocation()
} }
} }