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

Incorrect exception type for bad reference. #2289

Closed
nirvdrum opened this Issue Dec 8, 2014 · 3 comments

Comments

Projects
None yet
4 participants
@nirvdrum
Contributor

nirvdrum commented Dec 8, 2014

While digging through some stuff for Truffle, I came across an issue when calling an undefined variable or method. MRI raises a NameError. JRuby and Rubinius raise a NoMethodError.

$ ruby -v
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]
$ ruby -e 'a'
-e:1:in `<main>': undefined local variable or method `a' for main:Object (NameError)
$ ruby -v
ruby 2.2.0preview2 (2014-11-28 trunk 48628) [x86_64-linux]
$ ruby -e 'a'
-e:1:in `<main>': undefined local variable or method `a' for main:Object (NameError)
$ bin/jruby -v
jruby 9.0.0.0-SNAPSHOT (2.2.0p0) 2014-12-08 8a5ba25 Java HotSpot(TM) 64-Bit Server VM 24.72-b04 on 1.7.0_72-b14 +jit [linux-amd64]
$ bin/jruby -e 'a'
NoMethodError: undefined method `a' for main:Object
  __script__ at -e:1
$ bin/jruby -X+T -v
jruby 9.0.0.0-SNAPSHOT (2.2.0p0) 2014-12-08 8a5ba25 Java HotSpot(TM) 64-Bit Server VM 24.72-b04 on 1.7.0_72-b14 +jit [linux-amd64]
$ bin/jruby -X+T -e 'a'
-e:1:in `method_missing': undefined method `a' for org.jruby.truffle.runtime.core.RubyBasicObject@4ff2cd7f (NoMethodError)
    from -e:1:in `<main>'

@nirvdrum nirvdrum closed this in 4793478 Dec 9, 2014

@nirvdrum nirvdrum reopened this Dec 9, 2014

@headius

This comment has been minimized.

Member

headius commented Dec 10, 2014

Hmm, definitely is a bug, albeit not a serious one.

@headius headius added the JRuby 9000 label Dec 10, 2014

@headius headius added this to the JRuby 9.0.0.0 milestone Dec 10, 2014

@nirvdrum

This comment has been minimized.

Contributor

nirvdrum commented Dec 11, 2014

Fixing it in Truffle got another rubyspec passing. It's possible there's a win like that for non-Truffle JRuby. But otherwise, I agree it's low priority.

@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015

@MSNexploder

This comment has been minimized.

Contributor

MSNexploder commented May 21, 2017

Can be closed. Both 9.1.9.0 and 1.7.21 raise a NameError:

ruby -v
jruby 9.1.9.0 (2.3.3) 2017-05-15 28aa830 Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 [darwin-x86_64]

ruby -e 'a'
NameError: undefined local variable or method `a' for main:Object
  <main> at -e:1

@enebo enebo added this to the JRuby 9.2.0.0 milestone May 22, 2017

@enebo enebo closed this May 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment