[macruby-changes] [5164] MacRuby/trunk/object.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 13 22:20:16 PST 2011


Revision: 5164
          http://trac.macosforge.org/projects/ruby/changeset/5164
Author:   watson1978 at gmail.com
Date:     2011-01-13 22:20:10 -0800 (Thu, 13 Jan 2011)
Log Message:
-----------
Kernel#<=> will return 0 when receiver's == return true.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

class T
  def ==(x)
    true
  end
end

obj = T.new
assert_equal(0, obj.<=>("hello"))

puts :ok
}}}

Modified Paths:
--------------
    MacRuby/trunk/object.c

Modified: MacRuby/trunk/object.c
===================================================================
--- MacRuby/trunk/object.c	2011-01-14 02:21:41 UTC (rev 5163)
+++ MacRuby/trunk/object.c	2011-01-14 06:20:10 UTC (rev 5164)
@@ -1491,7 +1491,7 @@
 static VALUE
 rb_obj_cmp(VALUE obj1, SEL sel, VALUE obj2)
 {
-    if (rb_obj_equal(obj1, 0, obj2) == Qtrue) {
+    if (rb_equal(obj1, obj2) == Qtrue) {
 	return INT2FIX(0);
     }
     return Qnil;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110113/57070c0d/attachment-0001.html>


More information about the macruby-changes mailing list