зеркало из https://github.com/github/ruby.git
[ruby/irb] Assert lvars_code doesn't include \n
Removing /\A.+\n/ could have an unexpected impact, depending on how RubyLex.generate_local_variables_assign_code is implemented. It feels like a too much assumption and the intention isn't immediately clear, so I added these changes. https://github.com/ruby/irb/commit/ccc07a35ce
This commit is contained in:
Родитель
a09f764ce5
Коммит
931bcd1b63
|
@ -156,10 +156,10 @@ module IRB # :nodoc:
|
|||
end
|
||||
|
||||
if lvars_code
|
||||
colored.sub(/\A.+\n/, '')
|
||||
else
|
||||
colored
|
||||
raise "#{lvars_code.dump} should have no \\n" if lvars_code.include?("\n")
|
||||
colored.sub!(/\A.+\n/, '') # delete_prefix lvars_code with colors
|
||||
end
|
||||
colored
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Загрузка…
Ссылка в новой задаче