зеркало из https://github.com/github/ruby.git
* vm.c (m_core_define_method, m_core_define_singleton_method): now
the value of def-expr is the Symbol of the name of the method, not nil. ref. [ruby-dev:42151] [Feature #3753] * test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5339293fb8
Коммит
0f0b60ea86
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Fri Aug 2 23:57:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* vm.c (m_core_define_method, m_core_define_singleton_method): now
|
||||
the value of def-expr is the Symbol of the name of the method, not
|
||||
nil.
|
||||
ref. [ruby-dev:42151] [Feature #3753]
|
||||
|
||||
* test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for
|
||||
above changes.
|
||||
|
||||
Fri Aug 2 23:54:11 2013 Masaki Matsushita <glass.saga@gmail.com>
|
||||
|
||||
* array.c (rb_ary_zip): performance improvement by avoiding
|
||||
|
|
|
@ -370,6 +370,13 @@ eom
|
|||
end
|
||||
end
|
||||
|
||||
def test_value_of_def
|
||||
assert_separately [], <<-EOS
|
||||
assert_equal(:foo, (def foo; end))
|
||||
assert_equal(:foo, (def (Object.new).foo; end))
|
||||
EOS
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def not_label(x) @result = x; @not_label ||= nil end
|
||||
|
|
4
vm.c
4
vm.c
|
@ -2052,7 +2052,7 @@ m_core_define_method(VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
|
|||
REWIND_CFP({
|
||||
vm_define_method(GET_THREAD(), cbase, SYM2ID(sym), iseqval, 0, rb_vm_cref());
|
||||
});
|
||||
return Qnil;
|
||||
return sym;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -2061,7 +2061,7 @@ m_core_define_singleton_method(VALUE self, VALUE cbase, VALUE sym, VALUE iseqval
|
|||
REWIND_CFP({
|
||||
vm_define_method(GET_THREAD(), cbase, SYM2ID(sym), iseqval, 1, rb_vm_cref());
|
||||
});
|
||||
return Qnil;
|
||||
return sym;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче