Skip to content

Commit 7f5f443

Browse files
committed
add breaking test (acyclic detected as cyclic)
1 parent f70d444 commit 7f5f443

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/nested.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ test('cyclic (specifically allowed)', function (t) {
2626
one.two = two;
2727
t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}');
2828
});
29+
30+
test('acyclic but with reused obj-property pointers', function (t) {
31+
t.plan(1);
32+
var x = { a: 1 }
33+
var y = { b: x, c: x }
34+
t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}');
35+
});

0 commit comments

Comments
 (0)