[macruby-changes] [4577] MacRuby/trunk/NSArray.m

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 4 18:04:42 PDT 2010


Revision: 4577
          http://trac.macosforge.org/projects/ruby/changeset/4577
Author:   lsansonetti at apple.com
Date:     2010-10-04 18:04:41 -0700 (Mon, 04 Oct 2010)
Log Message:
-----------
fix a bug in -[NSArray ==:], make sure it returns false in case the receiver isn't an NSArray, instead of raising an exception

Modified Paths:
--------------
    MacRuby/trunk/NSArray.m

Modified: MacRuby/trunk/NSArray.m
===================================================================
--- MacRuby/trunk/NSArray.m	2010-10-04 23:58:28 UTC (rev 4576)
+++ MacRuby/trunk/NSArray.m	2010-10-05 01:04:41 UTC (rev 4577)
@@ -91,7 +91,10 @@
 static VALUE
 nsary_equal(id rcv, SEL sel, id other)
 {
-     return [rcv isEqualToArray:other] ? Qtrue : Qfalse;
+    if (![other isKindOfClass:(id)rb_cNSArray]) {
+	return Qfalse;
+    }
+    return [rcv isEqualToArray:other] ? Qtrue : Qfalse;
 }
 
 static VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101004/0125b85b/attachment.html>


More information about the macruby-changes mailing list