Feature #12495 ยป ruby_return_symbols_in_private.diff
test/ruby/test_syntax.rb | ||
---|---|---|
EOS
|
||
end
|
||
def test_value_of_private_def
|
||
assert_separately [], <<-EOS
|
||
assert_equal(:foo, (private def foo; end))
|
||
assert_equal(:bar, (private def bar; end))
|
||
assert_equal(:foo, (private def (Object.new).foo; end))
|
||
assert_nil(private)
|
||
assert_equal(:foo, (private :foo))
|
||
assert_equal([:foo, :bar], (private :foo, :bar))
|
||
EOS
|
||
end
|
||
def test_heredoc_cr
|
||
assert_syntax_error("puts <<""EOS\n""ng\n""EOS\r""NO\n", /can't find string "EOS" anywhere before EOF/)
|
||
end
|
vm_method.c | ||
---|---|---|
{
|
||
if (argc == 0) {
|
||
rb_scope_visibility_set(visi);
|
||
return Qnil;
|
||
}
|
||
else {
|
||
set_method_visibility(module, argc, argv, visi);
|
||
}
|
||
return module;
|
||
if (argc == 1) {
|
||
return argv[0];
|
||
}
|
||
else {
|
||
return rb_ary_new_from_values(argc, argv);
|
||
}
|
||
}
|
||
/*
|