Skip to content

Commit 287046e

Browse files
authored
Merge pull request #346 from github/erik-krogh/fix-primary-class-typo
fix typo for getAPrimaryQlClass
2 parents d448e20 + 1c5dcec commit 287046e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ql/lib/codeql/ruby/ast/Module.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class SingletonClass extends ModuleBase, TSingletonClass {
293293

294294
SingletonClass() { this = TSingletonClass(g) }
295295

296-
final override string getAPrimaryQlClass() { result = "ClassDeclaration" }
296+
final override string getAPrimaryQlClass() { result = "SingletonClass" }
297297

298298
/**
299299
* Gets the expression resulting in the object on which the singleton class

ql/test/library-tests/ast/Ast.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ calls/calls.rb:
196196
# 124| getStmt: [ClassDeclaration] MyClass2
197197
# 124| getSuperclassExpr: [MethodCall] call to foo
198198
# 124| getReceiver: [ConstantReadAccess] X
199-
# 128| getStmt: [ClassDeclaration] class << ...
199+
# 128| getStmt: [SingletonClass] class << ...
200200
# 128| getValue: [MethodCall] call to foo
201201
# 128| getReceiver: [Self] self
202202
# 129| getStmt: [MethodCall] call to bar
203203
# 129| getReceiver: [Self] self
204-
# 131| getStmt: [ClassDeclaration] class << ...
204+
# 131| getStmt: [SingletonClass] class << ...
205205
# 131| getValue: [MethodCall] call to foo
206206
# 131| getReceiver: [ConstantReadAccess] X
207207
# 132| getStmt: [MethodCall] call to bar
@@ -735,7 +735,7 @@ modules/classes.rb:
735735
# 40| getAnOperand/getLeftOperand: [LocalVariableAccess] x
736736
# 40| getAnOperand/getRightOperand: [StringLiteral] "hello"
737737
# 40| getComponent: [StringTextComponent] hello
738-
# 41| getStmt: [ClassDeclaration] class << ...
738+
# 41| getStmt: [SingletonClass] class << ...
739739
# 41| getValue: [LocalVariableAccess] x
740740
# 42| getStmt: [Method] length
741741
# 43| getStmt: [MulExpr] ... * ...

ql/test/library-tests/ast/modules/module_base.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ moduleBases
88
| classes.rb:20:1:37:3 | Wibble | ClassDeclaration |
99
| classes.rb:32:3:33:5 | ClassInWibble | ClassDeclaration |
1010
| classes.rb:35:3:36:5 | ModuleInWibble | ModuleDeclaration |
11-
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration |
11+
| classes.rb:41:1:52:3 | class << ... | SingletonClass |
1212
| classes.rb:55:1:56:3 | MyClassInGlobalScope | ClassDeclaration |
1313
| modules.rb:1:1:2:3 | Empty | ModuleDeclaration |
1414
| modules.rb:1:1:122:1 | modules.rb | Toplevel |

ql/test/library-tests/ast/modules/singleton_classes.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
singletonClasses
2-
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration | classes.rb:41:10:41:10 | x |
2+
| classes.rb:41:1:52:3 | class << ... | SingletonClass | classes.rb:41:10:41:10 | x |
33
exprsInSingletonClasses
44
| classes.rb:41:1:52:3 | class << ... | 0 | classes.rb:42:3:44:5 | length | Method |
55
| classes.rb:41:1:52:3 | class << ... | 1 | classes.rb:46:3:48:5 | wibble | Method |

0 commit comments

Comments
 (0)