# Code review - Fix backtrace and 1.9 support for RubyClass/RubyMethod attributes

**URL:** <https://www.ruby-forum.com/t/code-review-fix-backtrace-and-1-9-support-for-rubyclass-rubymethod-attributes/163471>\
**Category:** IronRuby\
**Created:** [March 20, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/code-review-fix-backtrace-and-1-9-support-for-rubyclass-rubymethod-attributes/163471 "2009-03-20T18:01:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [March 20, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/code-review-fix-backtrace-and-1-9-support-for-rubyclass-rubymethod-attributes/163471/1 "2009-03-20T18:01:48Z")

</div>

Assuming you have done “git clone git://github.com/shri/ironruby.git”  
before and run Languages\Ruby\Scripts\dev.bat,  
git pull  
GitDiff.bat ce7438b4c038dc8937f59758f33c387e139aea6a  
8cf29c0704af4d3fdf51069aa6cbf034b2974edd

Bactrace was being set to nil for “raise existingException, ‘new  
message’”. RubyOps.SetExceptionAndStrackTrace needs to call  
zSetCompiledTrace even if a RubyExceptionData exists for the exception,  
which it will for the case of raising with a new exception message. The  
current scheme is closer to MRI which checks if backtrace is set before  
calling set\_backtrace.  
Removed RubyOptions.DefaultExceptionDetail. It is no longer needed as  
always have access to a RubyContext when creating a backtrace which  
allows access to LanguageOptions.ExceptionDetail.  
Added support for Initializers.Generated to have constructs that exist  
in only a specific version of Ruby. Used that for “Encoding”.  
These two issues were affecting minitest (which is used by rubygems).  
With these fixes, minitest does not need any workarounds.

Thanks,  
Shri

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [March 24, 2009, 3:16am UTC](https://www.ruby-forum.com/t/code-review-fix-backtrace-and-1-9-support-for-rubyclass-rubymethod-attributes/163471/2 "2009-03-24T03:16:54Z")

</div>

Looks good.

Tomas

From: Shri B.  
Sent: Friday, March 20, 2009 9:59 AM  
To: IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
Subject: Code review - Fix backtrace and 1.9 support for  
RubyClass/RubyMethod attributes

Assuming you have done “git clone git://github.com/shri/ironruby.git”  
before and run Languages\Ruby\Scripts\dev.bat,  
git pull  
GitDiff.bat ce7438b4c038dc8937f59758f33c387e139aea6a  
8cf29c0704af4d3fdf51069aa6cbf034b2974edd

Bactrace was being set to nil for “raise existingException, ‘new  
message’”. RubyOps.SetExceptionAndStrackTrace needs to call  
zSetCompiledTrace even if a RubyExceptionData exists for the exception,  
which it will for the case of raising with a new exception message. The  
current scheme is closer to MRI which checks if backtrace is set before  
calling set\_backtrace.  
Removed RubyOptions.DefaultExceptionDetail. It is no longer needed as  
always have access to a RubyContext when creating a backtrace which  
allows access to LanguageOptions.ExceptionDetail.  
Added support for Initializers.Generated to have constructs that exist  
in only a specific version of Ruby. Used that for “Encoding”.  
These two issues were affecting minitest (which is used by rubygems).  
With these fixes, minitest does not need any workarounds.

Thanks,  
Shri
