Ruby: constant lookup is unaffected by blocks

This commit is contained in:
Asger F
2022-10-24 13:07:21 +02:00
parent 84ae17dcbb
commit 0ffb0f6d4d

View File

@@ -408,12 +408,8 @@ private module ResolveImpl {
string getAnAssumedGlobalConst() {
exists(ConstantAccess access |
not exists(access.getScopeExpr()) and
result = access.getName()
|
access.hasGlobalScope()
or
// At the top-level but not inside a block
enclosingModuleNoBlock(access) instanceof Toplevel
result = access.getName() and
isToplevel(access)
)
}