Project

General

Profile

Bug #5865 ยป exc_equal.patch

now (Nikolai Weibull), 01/09/2012 10:23 PM

View differences:

error.c
732 732
    CONST_ID(id_mesg, "mesg");
733 733

  
734 734
    if (rb_obj_class(exc) != rb_obj_class(obj)) {
735
	ID id_message, id_backtrace;
735
        VALUE klass;
736
	ID id_class, id_message, id_backtrace;
737
        CONST_ID(id_class, "class");
736 738
	CONST_ID(id_message, "message");
737 739
	CONST_ID(id_backtrace, "backtrace");
738 740

  
741
        klass = rb_check_funcall(obj, id_class, 0, 0);
742
        if (klass == Qundef) return Qfalse;
743
        if (!rb_equal(rb_obj_class(exc), klass))
744
            return Qfalse;
739 745
	mesg = rb_check_funcall(obj, id_message, 0, 0);
740 746
	if (mesg == Qundef) return Qfalse;
741 747
	backtrace = rb_check_funcall(obj, id_backtrace, 0, 0);
lib/delegate.rb
88 88
    r
89 89
  end
90 90

  
91
  def class
92
    __getobj__.class
93
  end
94

  
91 95
  #
92 96
  # Returns the methods available to this delegate object as the union
93 97
  # of this object's and \_\_getobj\_\_ methods.