Skip to content

Commit

Permalink
Fix TypeError when generating diff for an object with circular struct…
Browse files Browse the repository at this point in the history
…ure; fixes mochajs#1179
  • Loading branch information
skozin committed Apr 24, 2014
1 parent ca35545 commit 4395ae5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function stringify(obj) {
function canonicalize(obj, stack) {
stack = stack || [];

if (utils.indexOf(stack, obj) !== -1) return obj;
if (utils.indexOf(stack, obj) !== -1) return '[Circular]';

var canonicalizedObj;

Expand Down
2 changes: 1 addition & 1 deletion mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -2317,7 +2317,7 @@ function stringify(obj) {
function canonicalize(obj, stack) {
stack = stack || [];

if (utils.indexOf(stack, obj) !== -1) return obj;
if (utils.indexOf(stack, obj) !== -1) return '[Circular]';

var canonicalizedObj;

Expand Down

0 comments on commit 4395ae5

Please sign in to comment.