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

Socket.const_defined? returns false for constants defined in the scope in 1.8 mode #625

Closed
BanzaiMan opened this issue Apr 3, 2013 · 3 comments
Assignees
Milestone

Comments

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Apr 3, 2013

A simple test case:

$ jruby -v --1.8 -r socket -e 'p Socket.const_defined? "AF_INET6"; p Socket::AF_INET6'
jruby 1.7.4.dev (ruby-1.8.7p370) 2013-04-14 bfffb0e on Java HotSpot(TM) 64-Bit Server VM 1.7.0_17-b02 [darwin-x86_64]
false
30
$ jruby -v -r socket -e 'p Socket.const_defined? "AF_INET6"; p Socket::AF_INET6'      
jruby 1.7.4.dev (1.9.3p392) 2013-04-14 bfffb0e on Java HotSpot(TM) 64-Bit Server VM 1.7.0_17-b02 [darwin-x86_64]
true
30
@BanzaiMan
Copy link
Member Author

@BanzaiMan BanzaiMan commented Apr 3, 2013

Using the 1.9 mode code works (e374ac8), but I have not tested it extensively.

@BanzaiMan
Copy link
Member Author

@BanzaiMan BanzaiMan commented Sep 3, 2013

e374ac8 introduces one failure.

     [java] 1)
     [java] Module#const_defined? returns false if the constant is not defined in the receiver FAILED
     [java] Expected true
     [java]  to equal false
     [java] 
     [java] /Users/asari/Development/src/jruby/spec/ruby/core/module/const_defined_spec.rb:51:in `(root)'
     [java] org/jruby/RubyKernel.java:2194:in `instance_eval'
     [java] org/jruby/RubyEnumerable.java:1395:in `all?'
     [java] org/jruby/RubyFixnum.java:275:in `times'
     [java] org/jruby/RubyArray.java:1613:in `each'
     [java] /Users/asari/Development/src/jruby/spec/ruby/core/module/const_defined_spec.rb:4:in `(root)'
     [java] org/jruby/RubyKernel.java:1096:in `load'
     [java] org/jruby/RubyKernel.java:2194:in `instance_eval'
     [java] org/jruby/RubyArray.java:1613:in `each'
@kares
Copy link
Member

@kares kares commented Nov 14, 2015

fixed somewhere along the line ... 1.7.22 works as expected on --1.8 mode

@kares kares closed this Nov 14, 2015
@enebo enebo added this to the JRuby 1.7.23 milestone Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants