зеркало из https://github.com/github/ruby.git
bare_instructions.rb: use Hash#fetch to read attr
to raise descriptive KeyError instead of NoMethodError in case these attrs are accidentally removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
10ff0a2bbe
Коммит
6e3fe890d5
|
@ -102,11 +102,11 @@ class RubyVM::BareInstructions
|
|||
end
|
||||
|
||||
def handles_sp?
|
||||
/\b(false|0)\b/ !~ @attrs['handles_sp'].expr.expr
|
||||
/\b(false|0)\b/ !~ @attrs.fetch('handles_sp').expr.expr
|
||||
end
|
||||
|
||||
def always_leaf?
|
||||
@attrs['leaf'].expr.expr == 'true;'
|
||||
@attrs.fetch('leaf').expr.expr == 'true;'
|
||||
end
|
||||
|
||||
def complicated_return_values?
|
||||
|
|
Загрузка…
Ссылка в новой задаче