Skip to content

Commit f991991

Browse files
committed
Ruby: fix incomplete renaming of getCanonicalEnclosing/Nested module
1 parent a39cefe commit f991991

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPublic.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -957,21 +957,21 @@ class ModuleNode instanceof Module {
957957
/**
958958
* Gets the enclosing module, as it appears in the qualified name of this module.
959959
*
960-
* For example, the canonical enclosing module of `A::B` is `A`, and `A` itself has no canonical enclosing module.
960+
* For example, the parent module of `A::B` is `A`, and `A` itself has no parent module.
961961
*/
962-
ModuleNode getCanonicalEnclosingModule() { result = super.getParentModule() }
962+
ModuleNode getParentModule() { result = super.getParentModule() }
963963

964964
/**
965965
* Gets a module named `name` declared inside this one (not aliased), provided
966966
* that such a module is defined or reopened in the current codebase.
967967
*
968-
* For example, for `A::B` the canonical nested module named `C` would be `A::B::C`.
968+
* For example, for `A::B` the nested module named `C` would be `A::B::C`.
969969
*
970970
* Note that this is not the same as constant lookup. If `A::B::C` would resolve to a
971971
* module whose qualified name is not `A::B::C`, then it will not be found by
972972
* this predicate.
973973
*/
974-
ModuleNode getCanonicalNestedModule(string name) { result = super.getNestedModule(name) }
974+
ModuleNode getNestedModule(string name) { result = super.getNestedModule(name) }
975975
}
976976

977977
/**

ruby/ql/test/library-tests/dataflow/helpers/dataflow.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ getAnOwnInstanceVariableRead
166166
| tst.rb:1:1:6:3 | C1 | @field | tst.rb:4:9:4:14 | @field |
167167
getAnOwnInstanceVariableWriteValue
168168
| tst.rb:1:1:6:3 | C1 | @field | tst.rb:3:18:3:18 | 1 |
169-
getCanonicalEnclosingModule
169+
getParentModule
170170
| tst.rb:41:5:42:7 | N1::XY1 | tst.rb:40:1:47:3 | N1 |
171171
| tst.rb:43:5:46:7 | N1::N2 | tst.rb:40:1:47:3 | N1 |
172172
| tst.rb:44:9:45:11 | N1::N2::XY2 | tst.rb:43:5:46:7 | N1::N2 |
173173
| tst.rb:53:5:54:7 | N2::XY3 | tst.rb:49:1:51:3 | N2 |
174-
getCanonicalNestedModule
174+
getNestedModule
175175
| tst.rb:40:1:47:3 | N1 | N2 | tst.rb:43:5:46:7 | N1::N2 |
176176
| tst.rb:40:1:47:3 | N1 | XY1 | tst.rb:41:5:42:7 | N1::XY1 |
177177
| tst.rb:43:5:46:7 | N1::N2 | XY2 | tst.rb:44:9:45:11 | N1::N2::XY2 |

ruby/ql/test/library-tests/dataflow/helpers/dataflow.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ query DataFlow::Node getAnOwnInstanceVariableWriteValue(DataFlow::ModuleNode mod
4242
result = mod.getAnOwnInstanceVariableWriteValue(name)
4343
}
4444

45-
query DataFlow::ModuleNode getCanonicalEnclosingModule(DataFlow::ModuleNode mod) {
46-
result = mod.getCanonicalEnclosingModule()
45+
query DataFlow::ModuleNode getParentModule(DataFlow::ModuleNode mod) {
46+
result = mod.getParentModule()
4747
}
4848

49-
query DataFlow::ModuleNode getCanonicalNestedModule(DataFlow::ModuleNode mod, string name) {
50-
result = mod.getCanonicalNestedModule(name)
49+
query DataFlow::ModuleNode getNestedModule(DataFlow::ModuleNode mod, string name) {
50+
result = mod.getNestedModule(name)
5151
}
5252

5353
query DataFlow::Node getTopLevelConst(string name) { result = DataFlow::getConst(name) }

0 commit comments

Comments
 (0)