Skip to content

Commit

Permalink
Add comment to explain the use of shallow copying here
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Feb 27, 2024
1 parent e29c56e commit 352a556
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/internal/test_runner/reporter/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ function jsToYaml(indent, name, value, seen) {
}

if (errIsAssertion) {
// Note that we're deliberately creating shallow copies of the `seen`
// set here in order to isolate the discovery of circular references
// within the expected and actual properties respectively.
result += jsToYaml(indent, 'expected', errExpected, new SafeSet(seen));
result += jsToYaml(indent, 'actual', errActual, new SafeSet(seen));
if (errOperator) {
Expand Down

0 comments on commit 352a556

Please sign in to comment.