mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Convert to string before output in puts
For example, evaluating `puts nil` raised `NoMethodError` before.
This commit is contained in:
@@ -28,6 +28,7 @@ module Kernel
|
||||
if s.kind_of?(Array)
|
||||
puts(*s)
|
||||
else
|
||||
s = s.to_s
|
||||
print s
|
||||
print "\n" if (s[-1] != "\n")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user