class method
RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location
(::Thread::Backtrace::Location backtrace_location) -> ::Integer
RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location(backtrace_location) → integer
ast.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/ast.rb, line 110
def self.node_id_for_backtrace_location backtrace_location
Primitive.node_id_for_backtrace_location backtrace_location
end
Returns the node id for the given backtrace location.
Example
begin raise rescue => e loc = e.backtrace_locations.first RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location(loc) end # => 0