зеркало из https://github.com/github/ruby.git
* string.c (sym_call): use exact argument array interface.
[ruby-core:14279] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
64bc558cc5
Коммит
e3897c538c
|
@ -1,3 +1,8 @@
|
|||
Sun Dec 23 11:26:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (sym_call): use exact argument array interface.
|
||||
[ruby-core:14279]
|
||||
|
||||
Sun Dec 23 11:01:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_binmode_m): removed C99ism.
|
||||
|
|
|
@ -497,3 +497,13 @@ assert_equal 'ok', %q{
|
|||
result
|
||||
end
|
||||
}
|
||||
|
||||
assert_equal "ok", %q{
|
||||
class Bar
|
||||
def bar; :ok; end
|
||||
end
|
||||
def foo
|
||||
yield(Bar.new) if block_given?
|
||||
end
|
||||
foo(&:bar)
|
||||
}, '[ruby-core:14279]'
|
||||
|
|
|
@ -3,13 +3,6 @@
|
|||
# So all tests will cause failure.
|
||||
#
|
||||
|
||||
assert_normal_exit %q{
|
||||
def foo(&block)
|
||||
yield if block
|
||||
end
|
||||
foo(&:bar)
|
||||
}, '[ruby-core:14279]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("tmp", "w") {|f| f.write "a\u00FFb" }
|
||||
s = open("tmp", "r:iso-8859-1:utf-8") {|f|
|
||||
|
|
10
string.c
10
string.c
|
@ -5519,17 +5519,15 @@ sym_to_sym(VALUE sym)
|
|||
}
|
||||
|
||||
static VALUE
|
||||
sym_call(VALUE args, VALUE sym)
|
||||
sym_call(VALUE args, VALUE sym, int argc, VALUE *argv)
|
||||
{
|
||||
VALUE obj;
|
||||
|
||||
if (RARRAY_LEN(args) < 1) {
|
||||
if (argc < 1) {
|
||||
rb_raise(rb_eArgError, "no receiver given");
|
||||
}
|
||||
obj = RARRAY_PTR(args)[0];
|
||||
return rb_funcall3(obj, (ID)sym,
|
||||
RARRAY_LEN(args) - 1,
|
||||
RARRAY_PTR(args) + 1);
|
||||
obj = argv[0];
|
||||
return rb_funcall3(obj, (ID)sym, argc - 1, argv + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче