Skip to content

Commit f66896b

Browse files
committed
unified: Fix toString for extensions
1 parent 68e9550 commit f66896b

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/FacadeAst.qll‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ module Unified {
175175
this instanceof InitializerDeclaration and
176176
result = "(initializer block)"
177177
or
178-
this instanceof ClassLikeDeclaration and
179-
result = "(anonymous class)"
178+
exists(ClassLikeDeclaration cls | this = cls |
179+
result = NameBinding::getIdentifierFromRef(cls.getExtensionTarget()).getValue()
180+
or
181+
not exists(cls.getExtensionTarget()) and
182+
result = "(anonymous class)"
183+
)
180184
or
181185
this instanceof TypeAliasDeclaration and
182186
result = "(anonymous type alias)"

‎unified/ql/lib/codeql/unified/internal/LocalNameBinding.qll‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Provides classes for reasoning about lexically scoped names and references to these.
33
*/
4+
overlay[local?]
5+
module;
46

57
private import unified
68
private import unified as U

‎unified/ql/lib/codeql/unified/internal/StaticNameBinding.qll‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Provides classes for reasoning about static references to the members of classes and top-levels.
33
*/
4+
overlay[local?]
5+
module;
46

57
private import unified
68
private import codeql.unified.internal.LocalNameBinding

0 commit comments

Comments
 (0)