Bug #12938
closedforwardable.rb is no longer compatible with any alternative implementation
Description
The following commits have made forwardable.rb unusable on any implementation except MRI, because they use YARV-specific RubyVM module and features. I believe all of these changes were done by nobu.
These introduce uses of RubyVM::InstructionSequence, which does not (and probably will not ever) exist on other Ruby implementations:
r53383: forwardable.rb: adjust backtrace by tail call
r55376: forwardable.rb: optimize awy send
This commit moves code around, so I wasn't sure if anything incompatible was introduced.
r55366: forwardable.rb: fix for non-module objects
The standard library of Ruby is shared by all Ruby implementations, and I believe every effort should be made to avoid using MRI-specific features. If such features must be used, there must always be a fallback path that works on all Rubies of a given compatibility level (2.4 in this case).
Updated by headius (Charles Nutter) almost 10 years ago
This should be fixed before 2.4, so JRuby does not have to ship an old version of forwardable.rb.
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Status changed from Open to Closed
Applied in changeset r56848.
forwardable/impl.rb
- lib/forwardable/impl.rb (_valid_method?, _compile_method):
extract to separate implementation specific part.
[ruby-core:78138] [Bug #12938]
Updated by headius (Charles Nutter) almost 10 years ago
This is great, thanks nobu!