Skip to content

Commit 352a556

Browse files
committed
Add comment to explain the use of shallow copying here
1 parent e29c56e commit 352a556

File tree

1 file changed

+3
-0
lines changed
  • lib/internal/test_runner/reporter

1 file changed

+3
-0
lines changed

lib/internal/test_runner/reporter/tap.js

+3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ function jsToYaml(indent, name, value, seen) {
224224
}
225225

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

0 commit comments

Comments
 (0)