Actions
Bug #21776
closedBinding#local_variable_defined? still supports numbered parameters
Bug #21776:
Binding#local_variable_defined? still supports numbered parameters
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.0dev (2025-12-11T18:57:06Z master d02c971574) +PRISM [x86_64-linux]
Updated by mame (Yusuke Endoh) 8 months ago
Thanks! https://github.com/ruby/ruby/pull/15519 will fix the issue.
Updated by mame (Yusuke Endoh) 8 months ago
- Status changed from Open to Closed
Applied in changeset git|04494d9e4064a57accc8309da9b35754a3d24973.
Binding#local_variable_defined? must not handle numbered parameters
[Bug #21776]
Updated by mame (Yusuke Endoh) 8 months ago
I noticed that binding.local_variable_defined?(:@x) raises wrong local variable name '@x' for #<Binding:0x00007cd1e95a94d8> (NameError).
Maybe binding.local_variable_defined?(:_1) should raise a similar error because _1 is not a local variable. I will create a PR.
Updated by mame (Yusuke Endoh) 8 months ago
- Status changed from Closed to Open
Updated by mame (Yusuke Endoh) 8 months ago
- Status changed from Open to Closed
Applied in changeset git|1794cfe12fe61dedebadead542927f9fef4104eb.
Binding#local_variable_defined? raises a NameError for numbered params.
[Bug #21776]
Actions