1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Make only mesg can be assigned with default fname

This commit is contained in:
Nobuyoshi Nakada 2019-04-29 13:42:50 +09:00
parent 330b376133
commit 23375c8b81
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -500,7 +500,9 @@ EOT
end
end
def prepare_syntax_check(code, fname = caller_locations(2, 1)[0], mesg = fname.to_s, verbose: nil)
def prepare_syntax_check(code, fname = nil, mesg = nil, verbose: nil)
fname ||= caller_locations(2, 1)[0]
mesg ||= fname.to_s
verbose, $VERBOSE = $VERBOSE, verbose
case
when Array === fname