Project

General

Profile

Feature #12495 ยป ruby_return_symbols_in_private.diff

herwinw (Herwin Quarantainenet), 06/16/2016 07:51 AM

View differences:

test/ruby/test_syntax.rb
707 707
    EOS
708 708
  end
709 709

  
710
  def test_value_of_private_def
711
    assert_separately [], <<-EOS
712
      assert_equal(:foo, (private def foo; end))
713
      assert_equal(:bar, (private def bar; end))
714
      assert_equal(:foo, (private def (Object.new).foo; end))
715
      assert_nil(private)
716
      assert_equal(:foo, (private :foo))
717
      assert_equal([:foo, :bar], (private :foo, :bar))
718
    EOS
719
  end
720

  
710 721
  def test_heredoc_cr
711 722
    assert_syntax_error("puts <<""EOS\n""ng\n""EOS\r""NO\n", /can't find string "EOS" anywhere before EOF/)
712 723
  end
vm_method.c
1626 1626
{
1627 1627
    if (argc == 0) {
1628 1628
	rb_scope_visibility_set(visi);
1629
	return Qnil;
1629 1630
    }
1630 1631
    else {
1631 1632
	set_method_visibility(module, argc, argv, visi);
1632 1633
    }
1633
    return module;
1634
    if (argc == 1) {
1635
        return argv[0];
1636
    }
1637
    else {
1638
	return rb_ary_new_from_values(argc, argv);
1639
    }
1634 1640
}
1635 1641

  
1636 1642
/*