Skip to content

Commit

Permalink
simplify merge usage in method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianmariecom committed Oct 31, 2024
1 parent 1acddf4 commit fcd335d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/code/node/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def evaluate(**args)
last = Object::Nothing.new

(@statements || []).each do |statement|
last = statement.evaluate(**args.merge(object: Object::Global.new))
last = statement.evaluate(**args, object: Object::Global.new)
end

last
Expand Down
2 changes: 1 addition & 1 deletion lib/code/object/dictionary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def call(**args)
result = code_fetch(operator)

if result.is_a?(Function)
result.call(**args.merge(operator: nil))
result.call(**args, operator: nil)
else
sig(args)
result
Expand Down
2 changes: 1 addition & 1 deletion lib/code/object/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def call(**args)
result = context.code_fetch(operator)

if result.is_a?(Function)
result.call(**args.merge(operator: nil))
result.call(**args, operator: nil)
else
sig(args)
result
Expand Down

0 comments on commit fcd335d

Please sign in to comment.