<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -43,12 +43,13 @@ public class Error_c
   public function Init_Exception():void {
     rb_eException = rc.class_c.rb_define_class(&quot;Exception&quot;, rc.object_c.rb_cObject);
 
-    //rb_define_singleton_method(rb_eException, &quot;exception&quot;, rb_class_new_instance, -1);
+    rc.class_c.rb_define_singleton_method(rb_eException, &quot;exception&quot;,
+                                          rc.object_c.rb_class_new_instance, -1);
     //rb_define_method(rb_eException, &quot;exception&quot;, exc_exception, -1);
     rc.class_c.rb_define_method(rb_eException, &quot;initialize&quot;, exc_initialize, -1);
+    rc.class_c.rb_define_method(rb_eException, &quot;to_s&quot;, exc_to_s, 0);
     /*
     rb_define_method(rb_eException, &quot;==&quot;, exc_equal, 1);
-    rb_define_method(rb_eException, &quot;to_s&quot;, exc_to_s, 0);
     rb_define_method(rb_eException, &quot;message&quot;, exc_message, 0);
     rb_define_method(rb_eException, &quot;inspect&quot;, exc_inspect, 0);
     rb_define_method(rb_eException, &quot;backtrace&quot;, exc_backtrace, 0);
@@ -61,8 +62,8 @@ public class Error_c
     rb_eInterrupt = rc.class_c.rb_define_class(&quot;Interrupt&quot;, rb_eSignal);
 
     rb_eStandardError = rc.class_c.rb_define_class(&quot;StandardError&quot;, rb_eException);
-    rc.error_c.rb_eTypeError = rc.class_c.rb_define_class(&quot;TypeError&quot;, rb_eStandardError);
-    rc.error_c.rb_eArgError = rc.class_c.rb_define_class(&quot;ArgumentError&quot;, rb_eStandardError);
+    rb_eTypeError = rc.class_c.rb_define_class(&quot;TypeError&quot;, rb_eStandardError);
+    rb_eArgError = rc.class_c.rb_define_class(&quot;ArgumentError&quot;, rb_eStandardError);
     rb_eIndexError = rc.class_c.rb_define_class(&quot;IndexError&quot;, rb_eStandardError);
     rb_eKeyError = rc.class_c.rb_define_class(&quot;KeyError&quot;, rb_eIndexError);
     rb_eRangeError = rc.class_c.rb_define_class(&quot;RangeError&quot;, rb_eStandardError);
@@ -109,7 +110,7 @@ public class Error_c
     var arg:Value;
 
     //rb_scan_args(argc, argv, &quot;01&quot;, &amp;arg);
-    arg = argv.get_at(1);
+    arg = argv.get_at(0);
     rc.variable_c.rb_iv_set(exc, &quot;mesg&quot;, arg);
     rc.variable_c.rb_iv_set(exc, &quot;bt&quot;, rc.Qnil);
 
@@ -244,6 +245,17 @@ public class Error_c
     return rb_exc_new(etype, s);
   }
 
+  // error.c:415
+  public function
+  exc_to_s(exc:Value):Value
+  {
+    var mesg:Value = rc.variable_c.rb_attr_get(exc, rc.parse_y.rb_intern(&quot;mesg&quot;));
+
+    if (rc.NIL_P(mesg)) return rc.variable_c.rb_class_name(rc.CLASS_OF(exc));
+    if (rc.OBJ_TAINTED(exc)) rc.OBJ_TAINT(mesg);
+    return mesg;
+  }
+
   // error.c:645
   public function
   name_err_initialize(argc:int, argv:StackPointer, self:Value):Value</diff>
      <filename>flash/src/ruby/internals/Error_c.as</filename>
    </modified>
    <modified>
      <diff>@@ -77,6 +77,52 @@ public class Eval_c
   public function
   rb_make_exception(argc:int, argv:StackPointer):Value
   {
+    var mesg:Value;
+    var exception:int;
+    // special value here
+    var n:int = -1;
+
+    mesg = rc.Qnil;
+    switch (argc) {
+      case 0:
+        mesg = rc.Qnil;
+        break;
+      case 1:
+        if (rc.NIL_P(argv.get_at(0)))
+          break;
+        if (rc.TYPE(argv.get_at(0)) == Value.T_STRING) {
+          mesg = rc.error_c.rb_exc_new3(rc.error_c.rb_eRuntimeError, argv.get_at(0));
+          break;
+        }
+        n = 0;
+        // goto exception_call;
+      case 2:
+      case 3:
+        if (n != 0) {
+          n = 1;
+        }
+        // exception_call:
+        exception = rc.CONST_ID(&quot;exception&quot;);
+        if (!rc.vm_method_c.rb_respond_to(argv.get_at(0), exception)) {
+          rc.error_c.rb_raise(rc.error_c.rb_eTypeError, &quot;exception class/object expected&quot;);
+        }
+        mesg = rc.vm_eval_c.rb_funcall(argv.get_at(0), exception, n, argv.get_at(1));
+        break;
+      default:
+        rc.error_c.rb_raise(rc.error_c.rb_eArgError, &quot;wrong number of arguments&quot;);
+        break;
+    }
+    if (argc &gt; 0) {
+      if (!rc.object_c.rb_obj_is_kind_of(mesg, rc.error_c.rb_eException)) {
+        rc.error_c.rb_raise(rc.error_c.rb_eTypeError, &quot;exception object expected&quot;);
+      }
+      if (argc &gt; 2) {
+        // set_backtrace(mesg, argv.get_at(2));
+        trace(&quot;skipping set_backtrace&quot;);
+      }
+    }
+    return mesg;
+    /*
     if (argc == 1 &amp;&amp; rc.TYPE(argv.get_at(0)) == Value.T_STRING) {
       return rc.error_c.rb_exc_new3(rc.error_c.rb_eRuntimeError, argv.get_at(0));
     } else {
@@ -84,6 +130,7 @@ public class Eval_c
       return rc.error_c.rb_exc_new3(rc.error_c.rb_eRuntimeError,
         rc.string_c.rb_str_new(&quot;rb_make_exception: doesn't handle this case yet.&quot;));
     }
+    */
   }
 
   // eval.c:529</diff>
      <filename>flash/src/ruby/internals/Eval_c.as</filename>
    </modified>
    <modified>
      <diff>@@ -335,6 +335,7 @@ public class String_c
     rb_cSymbol = rc.class_c.rb_define_class(&quot;Symbol&quot;, rc.object_c.rb_cObject);
 
     // TODO: Lots of Symbol methods
+    rc.class_c.rb_define_method(rb_cString, &quot;+&quot;, rb_str_plus, 1);
 
   }
 </diff>
      <filename>flash/src/ruby/internals/String_c.as</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,26 @@
 
 # Testing exceptions
+puts &quot;start&quot;
+begin
+  raise StandardError, &quot;with description&quot;
+  puts &quot;** didn't raise&quot;
+rescue NoMethodError
+  puts &quot;** caught NoMethodError&quot;
+rescue RuntimeError
+  puts &quot;** caught RuntimeError&quot;
+rescue StandardError =&gt; bob
+  puts &quot;caught StandardError: &quot;+bob.to_s
+end
+
+begin
+  raise &quot;runtime error&quot;
+  puts &quot;** didn't raise&quot;
+rescue NoMethodError
+  puts &quot;** caught NoMethodError&quot;
+rescue
+  puts &quot;caught any error&quot;
+end
+
 puts &quot;Before Raise&quot;
 begin
   raise &quot;Something&quot;
@@ -11,9 +32,9 @@ end
 begin
   &quot;corey&quot;.i_do_not_exist
 rescue NoMethodError
-  puts &quot;wrong place&quot;
-rescue 
   puts &quot;right place&quot;
+rescue 
+  puts &quot;wrong place&quot;
 end
 
 class A
@@ -31,3 +52,4 @@ begin
 rescue
   puts &quot;Should rescue&quot;
 end
+</diff>
      <filename>research/exceptions.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3b563b045297da86c50eb60b73fc76b7205724ae</id>
    </parent>
  </parents>
  <author>
    <name>Jonathan Branam</name>
    <email>github@jonathanbranam.net</email>
  </author>
  <url>http://github.com/jonathanbranam/redsun/commit/c9fbb5d6bb895d4afa166904343edaf39d455768</url>
  <id>c9fbb5d6bb895d4afa166904343edaf39d455768</id>
  <committed-date>2008-12-15T19:49:31-08:00</committed-date>
  <authored-date>2008-12-15T19:49:31-08:00</authored-date>
  <message>Supporting 2 param format for raise.
Some fixes and support for 2 parameter format for raise.</message>
  <tree>5484cea4ffcc28579701d2234049ade8c03f9183</tree>
  <committer>
    <name>Jonathan Branam</name>
    <email>github@jonathanbranam.net</email>
  </committer>
</commit>
