[ruby/irb] Remove unused context argument from Worksapce#evaluate

(https://github.com/ruby/irb/pull/488)

The context argument was introduced in this change:

6806669d17 (diff-296327851fb7a2c307c2d0693b769f58c01aaf315972f290500d10081ee200a9)

perhaps for potential usages. But after that it's never used.
This commit is contained in:
Stan Lo 2023-02-18 11:34:23 +00:00 committed by git
parent de7eb5e79a
commit cbac0fa4cb
4 changed files with 6 additions and 6 deletions

View File

@ -494,7 +494,7 @@ module IRB
line = "#{command} #{command_class.transform_args(args)}"
end
set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
set_last_value(@workspace.evaluate(line, irb_path, line_no))
end
def inspect_last_value # :nodoc:

View File

@ -18,7 +18,7 @@ module IRB # :nodoc:
if defined?(@eval_history) && @eval_history
@eval_history_values.push @line_no, @last_value
@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
@workspace.evaluate "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
end
@last_value
@ -49,7 +49,7 @@ module IRB # :nodoc:
else
@eval_history_values = History.new(no)
IRB.conf[:__TMP__EHV__] = @eval_history_values
@workspace.evaluate(self, "__ = IRB.conf[:__TMP__EHV__]")
@workspace.evaluate("__ = IRB.conf[:__TMP__EHV__]")
IRB.conf.delete(:__TMP_EHV__)
end
else

View File

@ -65,12 +65,12 @@ module IRB
if context.use_tracer? && file != nil && line != nil
Tracer.on
begin
__evaluate__(context, statements, file, line)
__evaluate__(statements, file, line)
ensure
Tracer.off
end
else
__evaluate__(context, statements, file || __FILE__, line || __LINE__)
__evaluate__(statements, file || __FILE__, line || __LINE__)
end
end
end

View File

@ -109,7 +109,7 @@ EOF
attr_reader :main
# Evaluate the given +statements+ within the context of this workspace.
def evaluate(context, statements, file = __FILE__, line = __LINE__)
def evaluate(statements, file = __FILE__, line = __LINE__)
eval(statements, @binding, file, line)
end