throw stringifies the name #506

Closed
zenspider opened this Issue Jan 22, 2013 · 2 comments

Projects

None yet

2 participants

@zenspider
% ruby --1.8 -e 'begin throw :e; rescue Exception => e; p [e.class, e.message, (e.name rescue nil)]; end'
[NameError, "uncaught throw `e'", "e"]

vs MRI 1.8.7:

ruby -e 'begin throw :e; rescue Exception => e; p [e.class, e.message, (e.name rescue nil)]; end'
[NameError, "uncaught throw `e'", :e]

I'm getting this on a failing minitest test.

@enebo
Member
enebo commented Jan 22, 2013

Just adding a note here about 1.9 mode since we have an additional descrepency:

jruby -e 'begin throw :e; rescue Exception => e; p [e.class, e.message, (e.name rescue nil)]; end'
[ArgumentError, "uncaught throw `e'", nil]

Whereas mri19+:

mri19 -e 'begin throw :e; rescue Exception => e; p [e.class, e.message, (e.name rescue nil)]; end'
[ArgumentError, "uncaught throw :e", nil]
@enebo enebo added a commit that referenced this issue Jan 22, 2013
@enebo enebo GH #506: throw stringifies the name d7d1636
@enebo
Member
enebo commented Jan 22, 2013

We should match in both originally reported problem and also in the added mismatch in 1.9 mode I mentioned.

@enebo enebo closed this Jan 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment