You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Signal.signame raises instead of returning nil for unknown values #10094
One more difference I found since, which isn't Windows's alone: for a number with no signal, JRuby's Signal.signame raises where CRuby's returns nil. On JRuby 10.1.2.0, on macOS:
$ jruby -e 'p Signal.signame(99)'
ArgumentError: invalid signal number: 99
signame at org/jruby/RubySignal.java:210
<main> at -e:1
$ ruby -e 'p Signal.signame(99)'
nil
CRuby's sig_signame returns nil for a number signo2signm has no name for:
throwargumentError(context, "invalid signal number: " + rubySig);
}
returnnewString(context, signame);
}
So code written for CRuby that checks for nil (to name a signal by its number instead, say) gets an exception on JRuby. Returning nil there would match CRuby, and on Windows, Signal.signame(9) would then return nil rather than raise even before KILL is mapped.
Activity