зеркало из https://github.com/github/ruby.git
* vm_method.c (rb_method_boundp): revert r28543, r28564.
They may be merged in Ruby 2.0. [ruby-core:31217] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5647b2cd88
Коммит
ad717fa7e6
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 21 13:57:37 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vm_method.c (rb_method_boundp): revert r28543, r28564.
|
||||
They may be merged in Ruby 2.0. [ruby-core:31217]
|
||||
|
||||
Wed Jul 21 13:37:35 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/uri/common.rb: Have URI#route_to, URI#route_from accept
|
||||
|
|
|
@ -371,7 +371,7 @@ class TestMethod < Test::Unit::TestCase
|
|||
|
||||
assert_equal(true, respond_to?(:mv1))
|
||||
assert_equal(false, respond_to?(:mv2))
|
||||
assert_equal(false, respond_to?(:mv3))
|
||||
assert_equal(true, respond_to?(:mv3))
|
||||
|
||||
assert_equal(true, respond_to?(:mv1, true))
|
||||
assert_equal(true, respond_to?(:mv2, true))
|
||||
|
@ -393,7 +393,7 @@ class TestMethod < Test::Unit::TestCase
|
|||
|
||||
assert_equal(true, v.respond_to?(:mv1))
|
||||
assert_equal(false, v.respond_to?(:mv2))
|
||||
assert_equal(false, v.respond_to?(:mv3))
|
||||
assert_equal(true, v.respond_to?(:mv3))
|
||||
|
||||
assert_equal(true, v.respond_to?(:mv1, true))
|
||||
assert_equal(true, v.respond_to?(:mv2, true))
|
||||
|
|
21
vm_method.c
21
vm_method.c
|
@ -565,19 +565,18 @@ rb_method_boundp(VALUE klass, ID id, int ex)
|
|||
{
|
||||
rb_method_entry_t *me = rb_method_entry(klass, id);
|
||||
|
||||
if (!me) return 0;
|
||||
if (ex & ~NOEX_RESPONDS) { /* pub */
|
||||
if (me->flag & NOEX_PRIVATE) return 0;
|
||||
if (ex & NOEX_RESPONDS) {
|
||||
if (me->flag & NOEX_PROTECTED) return 0;
|
||||
if (me != 0) {
|
||||
if ((ex & ~NOEX_RESPONDS) && (me->flag & NOEX_PRIVATE)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!me->def) return 0;
|
||||
if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
|
||||
if (ex & NOEX_RESPONDS) return 2;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (!me->def) return 0;
|
||||
if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
|
||||
if (ex & NOEX_RESPONDS) return 2;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче