We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c3b401 commit 3c5d0d1Copy full SHA for 3c5d0d1
src/main/ruby/truffleruby/core/kernel.rb
@@ -203,7 +203,7 @@ def abort(msg = nil)
203
204
def autoload(name, file)
205
nesting = Primitive.caller_nesting
206
- mod = nesting.first || (Primitive.equal?(Kernel, self) ? Kernel : Object)
+ mod = nesting.first || Object
207
if Primitive.equal?(mod, self)
208
super(name, file) # Avoid recursion
209
else
@@ -213,10 +213,12 @@ def autoload(name, file)
213
module_function :autoload
214
215
def autoload?(name)
216
- if Primitive.equal?(Kernel, self)
+ nesting = Primitive.caller_nesting
217
218
+ if Primitive.equal?(mod, self)
219
super(name) # Avoid recursion
220
- Object.autoload?(name)
221
+ mod.autoload?(name)
222
end
223
224
module_function :autoload?
0 commit comments