Skip to content

Commit

Permalink
fixup! Prevent infinite recursion formatting cyclicly nested arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Mar 27, 2013
1 parent f2614d2 commit 70324d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,10 @@ policies and contribution forms [3].
}
if (typeof val === "object" && val !== null)
{
if (seen.indexOf(val) > -1) {
if (seen.indexOf(val) >= 0)
{
return "[...]";
}
}
seen.push(val);
}
if (Array.isArray(val))
Expand Down

0 comments on commit 70324d2

Please sign in to comment.