Revision
4169
Author
martinlagardette@apple.com
Date
2010-05-27 00:26:37 -0700 (Thu, 27 May 2010)

Log Message

Revert r4165 and fix the issue within MacRuby instead.

Modified Paths

Diff

Modified: MacRuby/trunk/lib/irb/formatter.rb (4168 => 4169)


--- MacRuby/trunk/lib/irb/formatter.rb	2010-05-26 23:38:25 UTC (rev 4168)
+++ MacRuby/trunk/lib/irb/formatter.rb	2010-05-27 07:26:37 UTC (rev 4169)
@@ -47,7 +47,6 @@
     end
     
     def exception(exception)
-      exception.set_backtrace([]) if exception.backtrace.nil? 
       backtrace = $DEBUG ? exception.backtrace : filter_backtrace(exception.backtrace)
       "#{exception.class.name}: #{exception.message}\n\t#{backtrace.join("\n\t")}"
     end

Modified: MacRuby/trunk/objc.m (4168 => 4169)


--- MacRuby/trunk/objc.m	2010-05-26 23:38:25 UTC (rev 4168)
+++ MacRuby/trunk/objc.m	2010-05-27 07:26:37 UTC (rev 4169)
@@ -638,7 +638,10 @@
     char buf[1000];
     snprintf(buf, sizeof buf, "%s: %s", [[exc name] UTF8String],
 	    [[exc reason] UTF8String]);
-    return rb_exc_new2(rb_eRuntimeError, buf);
+    VALUE e = rb_exc_new2(rb_eRuntimeError, buf);
+    // Set an empty backtrace for Obj-C exceptions (instead of nil)
+    rb_iv_set(e, "bt", rb_ary_new());
+    return e;
 }
 
 void