lib/contrast/agent/assess/policy/propagator/trim.rb in contrast-agent-3.14.0 vs lib/contrast/agent/assess/policy/propagator/trim.rb in contrast-agent-3.15.0
- old
+ new
@@ -14,13 +14,16 @@
class Trim
class << self
def tr_tagger patcher, preshift, ret, _block
return ret unless ret && !ret.empty?
+ properties = Contrast::Agent::Assess::Tracker.properties(ret)
+ return unless properties
+
source = preshift.object
args = preshift.args
- ret.cs__copy_from(source)
+ properties.copy_from(source, ret)
replace_string = args[1]
source_chars = source.chars
# if the replace string is empty, then there's a bunch of deletes. this
# functions the same as the Removal propagation.
if replace_string == Contrast::Utils::ObjectShare::EMPTY_STRING
@@ -39,14 +42,14 @@
start ||= idx
end
end
# account for the last char being different
remove_ranges << (start...source_chars.length) if start
- ret.cs__properties.delete_tags_at_ranges(remove_ranges, false)
+ properties.delete_tags_at_ranges(remove_ranges, false)
end
- ret.cs__properties.build_event(
+ properties.build_event(
patcher,
ret,
source,
ret,
args,
@@ -55,13 +58,16 @@
end
def tr_s_tagger patcher, preshift, ret, _block
return unless ret && !ret.empty?
+ properties = Contrast::Agent::Assess::Tracker.properties(ret)
+ return unless properties
+
source = preshift.object
args = preshift.args
- source.cs__splat_tags(ret)
- ret.cs__properties.build_event(
+ properties.splat_from(source, ret)
+ properties.build_event(
patcher,
ret,
source,
ret,
args)