Files
mruby-mruby/mrblib/10error.rb
Yukihiro "Matz" Matsumoto ec1f9860b1 mrblib: add parentheses to method calls with used return values
added parentheses to all `to_enum` and `super` calls where the return
value is used (returned, assigned, or passed to another method). this
makes the code style consistent with the guideline that method calls
should use parentheses when their return values are consumed.

changes:
- return to_enum :symbol -> return to_enum(:symbol)
- return to_enum :symbol, arg -> return to_enum(:symbol, arg)
- super message, name -> super(message, name)

affected files: 10error.rb, array.rb, enum.rb, hash.rb, kernel.rb,
numeric.rb, range.rb

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-11 18:09:06 +09:00

24 lines
387 B
Ruby

# ISO 15.2.31
class NameError < StandardError
attr_accessor :name
def initialize(message=nil, name=nil)
@name = name
super(message)
end
end
# ISO 15.2.32
class NoMethodError < NameError
attr_reader :args
def initialize(message=nil, name=nil, args=nil)
@args = args
super(message, name)
end
end
class StopIteration < IndexError
attr_accessor :result
end