зеркало из https://github.com/github/ruby.git
parse.y: empty hash in defined
* parse.y (command): NODE_ARRAY with NULL is invalid. traversal in defined_expr0 is simplified than iseq_compile_each0. [ruby-core:82113] [Bug #13756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8c5e7c59ff
Коммит
19e687ff03
2
parse.y
2
parse.y
|
@ -2293,7 +2293,7 @@ call_args : command
|
|||
| assocs opt_block_arg
|
||||
{
|
||||
/*%%%*/
|
||||
$$ = NEW_LIST($1 ? new_hash($1) : 0);
|
||||
$$ = $1 ? NEW_LIST(new_hash($1)) : 0;
|
||||
$$ = arg_blk_pass($$, $2);
|
||||
/*%
|
||||
$$ = arg_add_assocs(arg_new(), $1);
|
||||
|
|
|
@ -169,10 +169,16 @@ class TestSyntax < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_keyword_empty_splat
|
||||
assert_separately([], <<-'end;')
|
||||
assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
|
||||
begin;
|
||||
bug10719 = '[ruby-core:67446] [Bug #10719]'
|
||||
assert_valid_syntax("foo(a: 1, **{})", bug10719)
|
||||
end;
|
||||
assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
|
||||
begin;
|
||||
bug13756 = '[ruby-core:82113] [Bug #13756]'
|
||||
assert_valid_syntax("defined? foo(**{})", bug13756)
|
||||
end;
|
||||
end
|
||||
|
||||
def test_keyword_self_reference
|
||||
|
|
Загрузка…
Ссылка в новой задаче