Skip to content

Commit dc8ae24

Browse files
committed
Revert "[Bug #21256] Fix it parameter when splatting and define_method is…"
This reverts commit 2650596.
1 parent 81515ac commit dc8ae24

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

prism_compile.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6777,17 +6777,6 @@ pm_compile_scope_node(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_nod
67776777
body->param.flags.has_lead = true;
67786778
}
67796779

6780-
if (scope_node->parameters && PM_NODE_TYPE_P(scope_node->parameters, PM_IT_PARAMETERS_NODE)) {
6781-
const uint8_t param_name[] = { 'i', 't' };
6782-
pm_constant_id_t constant_id = pm_constant_pool_find(&scope_node->parser->constant_pool, param_name, 2);
6783-
RUBY_ASSERT(constant_id && "parser should fill in `it` parameter");
6784-
pm_insert_local_index(constant_id, local_index, index_lookup_table, local_table_for_iseq, scope_node);
6785-
6786-
local_index++;
6787-
body->param.lead_num = 1;
6788-
body->param.flags.has_lead = true;
6789-
}
6790-
67916780
//********END OF STEP 3**********
67926781

67936782
//********STEP 4**********

test/ruby/test_syntax.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,19 +1957,6 @@ def test_it
19571957
assert_equal(/9/, eval('9.then { /#{it}/o }'))
19581958
end
19591959

1960-
def test_it_with_splat_super_method
1961-
bug21256 = '[ruby-core:121592] [Bug #21256]'
1962-
1963-
a = Class.new do
1964-
define_method(:foo) { it }
1965-
end
1966-
b = Class.new(a) do
1967-
def foo(*args) = super
1968-
end
1969-
1970-
assert_equal(1, b.new.foo(1), bug21256)
1971-
end
1972-
19731960
def test_value_expr_in_condition
19741961
mesg = /void value expression/
19751962
assert_syntax_error("tap {a = (true ? next : break)}", mesg)

0 commit comments

Comments
 (0)