Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Jun 7, 2024
1 parent ec0400b commit 287b2b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ const newQueuedEvent = (rrwebMethod: () => void): QueuedRRWebEvent => ({

const LOGGER_PREFIX = '[SessionRecording]'

// taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value#circular_references
function circularReferenceReplacer() {
const ancestors: any[] = []
return function (_key: string, value: any) {
if (isObject(value)) {
// `this` is the object that value is contained in,
// i.e., its direct parent.
// @ts-expect-error - TS was unhappy with `this` on the next line but the code is copied in from MDN
while (ancestors.length > 0 && ancestors.at(-1) !== this) {
ancestors.pop()
}
Expand Down

0 comments on commit 287b2b3

Please sign in to comment.