rubinius/rubinius — Issue #1547: Variable is not created if it's defined in code that never runs
Author: cheba
Created: 2012-02-06 10:24:20+00:00
State: open

In MRI (and JRuby) following code will not raise NameError.

```ruby
if false
a = 1
end

a
# => nil
```

In rbx that code that will raise NameError: undefined local variable or method `a' on an instance of Object.

According to [issue 2362](http://bugs.ruby-lang.org/issues/2362) in Ruby Redmine this behavior is "well-known and well-documented". On the other hand I couldn't find it in Rubyspec anywhere.