summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-18 12:34:59 -0700
committerJeremy Evans <code@jeremyevans.net>2019-10-21 14:16:45 -0700
commit73c1a2b4e0f86f773a440d4bfa178d5cd1333127 (patch)
treec35037ab1c619f54eb6caf09d63399257ac300ad /lib
parent0910ae5575786d57783eafd4d03ebc0d077cd2ed (diff)
downloadpsych-73c1a2b4e0f86f773a440d4bfa178d5cd1333127.zip
Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. I'm not sure if the untaint calls in deduplicate are still needed after the removal of tainting in the parser. If they are not needed, they should be removed.
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/visitors/to_ruby.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb
index 49447e1..b72fb4a 100644
--- a/lib/psych/visitors/to_ruby.rb
+++ b/lib/psych/visitors/to_ruby.rb
@@ -368,11 +368,9 @@ module Psych
hash
end
- if String.method_defined?(:-@)
+ if RUBY_VERSION < '2.7'
def deduplicate key
if key.is_a?(String)
- # It is important to untaint the string, otherwise it won't
- # be deduplicated into and fstring, but simply frozen.
-(key.untaint)
else
key
@@ -381,9 +379,7 @@ module Psych
else
def deduplicate key
if key.is_a?(String)
- # Deduplication is not supported by this implementation,
- # but we emulate it's side effects
- key.untaint.freeze
+ -key
else
key
end