mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
d3128ce58a
Calling `Class#allocate` with `UnboundMethod#bind_call` usually succeeds without problems. If this behavior does not make us happy, we can now prohibit it with `MRB_SET_INSTANCE_TT(klass, MRB_TT_UNDEF)`. At the same time, it applies to the `Binding`, `Complex`, `Data`, `Float`, `Integer`, `Method`, `Rational` and `UnboundMethod` classes.
mruby-method
An implementation of class Method and UnboundMethod for mruby
p Enumerable.instance_method(:find_all).source_location
#=> ["mruby/mruby/mrblib/enum.rb", 148]
Note
You need to enable debug option in your build configuration to use
source_location method in this gem, for example:
MRuby::Build.new do |conf|
conf.enable_debug
end
Supported Methods
Kernel
Kernel#methodKernel#singleton_method
Module
Module#instance_method
Method class
Method#nameMethod#callMethod#super_methodMethod#arityMethod#unbindMethod#[]Method#ownerMethod#receiverMethod#parametersMethod#source_locationMethod#to_proc
UnboundMethod class
UnboundMethod#nameUnboundMethod#bindUnboundMethod#super_methodUnboundMethod#arityUnboundMethod#ownerUnboundMethod#parametersUnboundMethod#source_location