Fix one-by-one error of numbered parameter ID
This commit is contained in:
parent
081a44f586
commit
9a41d76b83
Notes:
git
2025-05-21 13:12:49 +00:00
2
proc.c
2
proc.c
@ -507,7 +507,7 @@ bind_local_variables(VALUE bindval)
|
||||
int
|
||||
rb_numparam_id_p(ID id)
|
||||
{
|
||||
return (tNUMPARAM_1 << ID_SCOPE_SHIFT) <= id && id < ((tNUMPARAM_1 + 10) << ID_SCOPE_SHIFT);
|
||||
return (tNUMPARAM_1 << ID_SCOPE_SHIFT) <= id && id < ((tNUMPARAM_1 + 9) << ID_SCOPE_SHIFT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1637,6 +1637,10 @@ class TestProc < Test::Unit::TestCase
|
||||
assert_equal(3, b.local_variable_get(:when))
|
||||
assert_equal(4, b.local_variable_get(:begin))
|
||||
assert_equal(5, b.local_variable_get(:end))
|
||||
|
||||
assert_raise_with_message(NameError, /local variable \Wdefault\W/) {
|
||||
binding.local_variable_get(:default)
|
||||
}
|
||||
end
|
||||
|
||||
def test_local_variable_set
|
||||
|
Loading…
x
Reference in New Issue
Block a user