rubinius/rubinius — Issue #1581: __FILE__ in a Binding being overwritten
Author: banister
Created: 2012-02-29 04:51:02+00:00
State: open

When using `binding.eval(code, my_file)` the `my_file` seems to overwrite the actual `__FILE__` for the binding causing subsequent calls to `binding.eval("__FILE__")` to return `my_file`.

MRI behaviour:

```ruby
> b.eval("__FILE__")
=> "(pry)"
> b.eval(":hello", "pig.rb")
=> :hello
> b.eval("__FILE__")
=> "(pry)"
```

Rubinius behaviour:

```ruby
> b.eval("__FILE__")
=> "(pry)"
> b.eval(":hello", "pig.rb")
=> :hello
> b.eval("__FILE__")
=> "pig.rb"
```