Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel.load(..., true) --> scope problem #2374

Closed
headius opened this issue Dec 29, 2014 · 1 comment
Closed

Kernel.load(..., true) --> scope problem #2374

headius opened this issue Dec 29, 2014 · 1 comment

Comments

@headius
Copy link
Member

@headius headius commented Dec 29, 2014

From http://jira.codehaus.org/browse/JRUBY-6738

Early versions of MRI 1.9.2 had a "scope" problem when Kernel.load was used with a "true" second parameter. I reported it as

http://bugs.ruby-lang.org/issues/1982

JRuby seem to fail in the same way (both in 1.8 and 1.9 mode). I attach a script showing the problem. JRuby reports:

$ jruby -e 'load "helloworld.rb", true' 
NameError: uninitialized constant #<Module:0x4a005364>::HelloWorld::Hello
  const_missing at org/jruby/RubyModule.java:2715
            say at /Users/johan/proj/rcons-stuff/rcons-cpp/helloworld.rb:17
         (root) at /Users/johan/proj/rcons-stuff/rcons-cpp/helloworld.rb:21
           load at org/jruby/RubyKernel.java:1017
         (root) at -e:1

but if run with the second paramter set to "false" it works better:

$ jruby -e 'load "helloworld.rb", false'
Hello
World

I think it should have worked in the first case too.

@MSNexploder
Copy link
Contributor

@MSNexploder MSNexploder commented Jun 3, 2017

Works as expected using 9.1.10.0:

jruby -e 'load "helloworld.rb", true'
Hello
World
jruby -e 'load "helloworld.rb", false'
Hello
World

@kares kares added this to the JRuby 9.1.9.0 milestone Jun 4, 2017
@kares kares closed this Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants