#319 open
kwatch

[BUG] $SAFE should be Proc local

Reported by kwatch | February 11th, 2008 @ 02:21 AM | in 1.1

$SAFE is Proc local in Ruby but not in Rubinius.

hoge.rb:

puts   "*** before:  $SAFE=#{$SAFE.inspect}"
proc {
  $SAFE = 2
  puts "*** in proc: $SAFE=#{$SAFE}"
}.call
puts   "*** after:   $SAFE=#{$SAFE.inspect}"

result:

$ ruby hoge.rb
*** before:  $SAFE=0
*** in proc: $SAFE=2
*** after:   $SAFE=0     # not changed
$ shotgun/rubinius hoge.rb
*** before:  $SAFE=0
*** in proc: $SAFE=2
*** after:   $SAFE=2     # CHANGED!

environment:

$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-darwin8.11.1]
$ shotgun/rubinius -v
rubinius 0.8.0 (ruby 1.8.6 compatible) (2ffa558ee) (02/08/2008) [i686-apple-darwin8.11.1]

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags