Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ruby/truffle/jruby+truffle/lib/runner.rb
Original file line number Diff line number Diff line change
@@ -335,6 +335,9 @@ def construct_default_options
def self.default_option_values(group_options)
group_options.each_with_object({}) do |(option, data), group_option_defaults|
*args, block, default = data
unless [TrueClass, FalseClass, NilClass, Fixnum].any? { |v| v === default }
default = default.clone
end
group_option_defaults[option] = default
end
end

2 comments on commit 60a2a84

@eregon
Copy link
Member

@eregon eregon commented on 60a2a84 Mar 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the default options values could be .freeze to make sure they are not modified?

Sorry, something went wrong.

@pitr-ch
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, good idea

Sorry, something went wrong.

Please sign in to comment.