lib/contrast/agent/assess/contrast_event.rb in contrast-agent-3.14.0 vs lib/contrast/agent/assess/contrast_event.rb in contrast-agent-3.15.0
- old
+ new
@@ -49,17 +49,11 @@
# we can't just check respond_to? though b/c dup exists on the
# base Object class
def safe_dup original
return nil unless original
- begin
- duplicate = original.dup
- original.cs__transfer_properties(duplicate)
- duplicate
- rescue StandardError
- original
- end
+ Contrast::Agent::Assess::Tracker.duplicate(original)
end
end
attr_reader :event_id, :parent_ids, :policy_node, :stack_trace, :time, :thread, :object, :ret, :args
@@ -95,16 +89,14 @@
def find_parent_ids policy_node, object, ret, args
mapped = policy_node.sources.map do |source|
value_of_source(source, object, ret, args)
end
selected = mapped.select do |source|
- source &&
- Contrast::Utils::DuckUtils.quacks_to?(source, :cs__properties) &&
- source.cs__properties.events &&
- source.cs__properties.events.last
+ source && Contrast::Agent::Assess::Tracker.properties(source)&.events&.last
end
selected.map do |source|
- source.cs__properties.events.last.event_id
+ properties = Contrast::Agent::Assess::Tracker.properties(source)
+ properties.events.last.event_id
end
end
def snapshot tagged, object, ret, args
target = @policy_node.target