Bug #15985 ยป methodref-literal-compile-fix.patch
| compile.c | ||
|---|---|---|
|
break;
|
||
|
}
|
||
|
case NODE_METHREF:
|
||
|
CHECK(COMPILE_(ret, "receiver", node->nd_recv, popped));
|
||
|
CHECK(COMPILE(ret, "receiver", node->nd_recv));
|
||
|
ADD_ELEM(ret, &new_insn_body(iseq, line, BIN(methodref), 1, ID2SYM(node->nd_mid))->link);
|
||
|
if (popped) {
|
||
|
ADD_INSN(ret, line, pop);
|
||
|
}
|
||
|
break;
|
||
|
default:
|
||
|
UNKNOWN_NODE("iseq_compile_each", node, COMPILE_NG);
|
||
| test/ruby/test_syntax.rb | ||
|---|---|---|
|
assert_valid_syntax("tap (proc do end)", __FILE__, bug9726)
|
||
|
end
|
||
|
def test_methodref_literal
|
||
|
assert_separately [], <<-EOS
|
||
|
eval 'nil.:|;1'
|
||
|
1000.times{eval 'nil.:|;1'}
|
||
|
EOS
|
||
|
end
|
||
|
def test_normal_argument
|
||
|
assert_valid_syntax('def foo(x) end')
|
||
|
assert_syntax_error('def foo(X) end', /constant/)
|
||