Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Binding#self and #self=
Browse files Browse the repository at this point in the history
In Ruby 2.2+, we have #receiver, so it makes sense to use consistent names
here and and get rid of #self and #self= in favor of #receiver and #receiver=
jemc committed Mar 11, 2015
1 parent 59d6f28 commit ccf1686
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions kernel/common/binding.rb
Original file line number Diff line number Diff line change
@@ -4,15 +4,7 @@ class Binding
attr_accessor :constant_scope
attr_accessor :proc_environment
attr_accessor :location
attr_reader :receiver

def self=(obj)
@receiver = obj
end

def self
@receiver
end
attr_accessor :receiver

def from_proc?
@proc_environment
@@ -37,7 +29,7 @@ def self.self_context(recv, variables)
def self.setup(variables, code, constant_scope, recv=nil, location=nil)
bind = allocate()

bind.self = self_context(recv, variables)
bind.receiver = self_context(recv, variables)
bind.variables = variables
bind.compiled_code = code
bind.constant_scope = constant_scope
2 changes: 1 addition & 1 deletion kernel/common/eval.rb
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ def eval(string, binding=nil, filename=nil, lineno=nil)
c = Rubinius::ToolSets::Runtime::Compiler
be = c.construct_block string, binding, filename, lineno

result = be.call_on_instance(binding.self)
result = be.call_on_instance(binding.receiver)
binding.constant_scope = existing_scope
result
end

0 comments on commit ccf1686

Please sign in to comment.