[Bug:1.9] $! in at_exit


#1

e$B1sF#$G$9!#e(B

at_exit e$B$NCf$Ge(B $! e$B$,;2>H$G$-$^$;$s!#e(B

$ ruby19 -ve ‘at_exit { p $! }; raise “foo”’
ruby 1.9.0 (2008-11-09 revision 20163) [i686-linux]
nil
-e:1:in `’: foo (RuntimeError)

e$B%9%?%C%/%H%l!<%9$r<+J,$G@07A$7$FI=<($7$?$$$H$-$K!"e(B1.8
e$B$N5sF0$NJ}$,e(B
e$BJXMx$G$9!#e(B
e$B$^$?!"F1$8F05!$G!"e(B$! = nil e$B$b$d$C$Q$j5v2D$7$FM_$7$$$G$9!#e(B

e$B$A$J$_$K!"e(Bat_exit e$B$NCf$Ge(B raise
e$B$9$k$HK\BN$,Ej$2$?Nc30$r:FEYEj$2$^$9e(B
(e$BEj$2$k$h$&$K8+$($^$9e(B) e$B!#$3$l$OIT<+A3$@$H;W$$$^$9!#e(B

$ ruby19 -ve ‘at_exit { raise }; foo’
ruby 1.9.0 (2008-11-09 revision 20163) [i686-linux]
-e:1:in <main>': undefined local variable or methodfoo’ for
main:Object (NameError)
-e:1:in <main>': undefined local variable or methodfoo’ for
main:Object (NameError)


#2

e$B!!$5$5$@$G$9!%e(B

Yusuke ENDOH wrote::

e$B$^$?!"F1$8F05!$G!"e(B$! = nil e$B$b$d$C$Q$j5v2D$7$FM_$7$$$G$9!#e(B
e$B!!$3$l!$@hF|$N3+H/<T%_!<%F%#%s%0$N%a%b$r8+$?$s$G$9$,!$e(B

  • Bug #732 [ruby-dev:37046]:
    • (1) e$B;2>H$O$G$-$k$h$&$K$9$ke(B
    • (2) nil e$B$K$9$ke(B -> e$BM%@hEY$ODc$$!%e(Bat_exit
      e$B$h$jA0$K$D$V$9$Y$-e(B

e$B$H$J$C$F$^$7$?!%$H$j$"$($:e(B $!
e$B$G8+$($k$h$&$K$9$k$N$,5^L3$G$9$+$M$’!%BeF~e(B
e$B$O=PMh$k$h$&$K$9$k$+$O$o$+$j$^$;$s!%e(B

e$B$A$J$_$K!"e(Bat_exit e$B$NCf$Ge(B raise e$B$9$k$HK\BN$,Ej$2$?Nc30$r:FEYEj$2$^$9e(B
(e$BEj$2$k$h$&$K8+$($^$9e(B) e$B!#$3$l$OIT<+A3$@$H;W$$$^$9!#e(B

$ ruby19 -ve ‘at_exit { raise }; foo’
ruby 1.9.0 (2008-11-09 revision 20163) [i686-linux]
-e:1:in <main>': undefined local variable or methodfoo’ for
main:Object (NameError)
-e:1:in <main>': undefined local variable or methodfoo’ for
main:Object (NameError)

e$B!!$3$C$A$O5DO@$7$F$J$+$C$?$h$&$J5$$,$7$^$9$,!$$3$l$O$"$+$i$5$^$KJQ$@e(B
e$B$J$!!$$H;W$&$N$G$J$*$7$^$9!%e(B


#3

e$B%A%1%C%He(B #732 e$B$,99?7$5$l$^$7$?!#e(B (by Koichi Sasada)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r21086.

http://redmine.ruby-lang.org/issues/show/732