[macruby-changes] [5148] MacRuby/trunk/object.c
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jan 10 01:09:54 PST 2011
Revision: 5148
http://trac.macosforge.org/projects/ruby/changeset/5148
Author: watson1978 at gmail.com
Date: 2011-01-10 01:09:48 -0800 (Mon, 10 Jan 2011)
Log Message:
-----------
revert r5147. Object#new of CRuby1.9.2 accept variable-length argument, however, it is not good. Because, in the class which does not prepare #initialize, will accept a variable-length argument. Thank you, @nagachika and @takaokouji.
(NOTE: Object#new of CRuby1.9.3 does not accept variable-length argument).
Test Script:
{{{
class X
def y
end
end
X.new(42) # => should raise a exception.
}}}
Revision Links:
--------------
http://trac.macosforge.org/projects/ruby/changeset/5147
Modified Paths:
--------------
MacRuby/trunk/object.c
Modified: MacRuby/trunk/object.c
===================================================================
--- MacRuby/trunk/object.c 2011-01-10 06:53:29 UTC (rev 5147)
+++ MacRuby/trunk/object.c 2011-01-10 09:09:48 UTC (rev 5148)
@@ -2982,14 +2982,14 @@
rb_objc_define_direct_method(*(VALUE *)rb_cNSObject, "new:", rb_class_new_instance_imp, -1);
- rb_objc_define_private_method(rb_cNSObject, "initialize", rb_obj_dummy, -1);
+ rb_objc_define_private_method(rb_cNSObject, "initialize", rb_obj_dummy, 0);
rb_objc_define_method(rb_cRubyObject, "==", rb_obj_equal, 1);
rb_objc_define_method(rb_cNSObject, "equal?", rb_obj_equal, 1);
rb_objc_define_method(rb_cNSObject, "==", rb_nsobj_equal, 1);
rb_objc_define_method(rb_cNSObject, "!", rb_obj_not, 0);
rb_objc_define_method(rb_cNSObject, "!=", rb_obj_not_equal, 1);
- rb_objc_define_private_method(rb_cBasicObject, "initialize", rb_obj_dummy, -1);
+ rb_objc_define_private_method(rb_cBasicObject, "initialize", rb_obj_dummy, 0);
rb_objc_define_method(rb_cBasicObject, "==", rb_obj_equal, 1);
rb_objc_define_method(rb_cBasicObject, "equal?", rb_obj_equal, 1);
rb_objc_define_method(rb_cBasicObject, "!", rb_obj_not, 0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110110/d8791830/attachment-0001.html>
More information about the macruby-changes
mailing list