3 <title>Recursive value
</title>
4 <link rel=
"author" href=
"mailto:odinho@opera.com" title=
"Odin Hørthe Omdal">
5 <script src=
"../../../resources/testharness.js"></script>
6 <script src=
"../../../resources/testharnessreport.js"></script>
7 <script src=
"support.js"></script>
10 function recursive_value(desc
, value
) {
11 var db
, t
= async_test(document
.title
+ " - " + desc
);
13 createdb(t
).onupgradeneeded = function(e
) {
15 db
.createObjectStore("store")
18 e
.target
.onsuccess
= t
.step_func(function(e
) {
19 db
.transaction('store')
22 .onsuccess
= t
.step_func(function(e
)
27 var fresh_value
= JSON
.stringify(value
);
28 assert_unreached("Testcase is written wrongly, must supply something recursive (that JSON won't stringify).");
32 if (e
.name
== 'TypeError')
36 JSON
.stringify(e
.target
.result
);
37 assert_unreached("Expected a non-JSON-serializable value back, didn't get that.");
54 recursive
.push(recursive
);
55 recursive_value('array directly contains self', recursive
);
58 recursive2
.push([recursive2
]);
59 recursive_value('array indirectly contains self', recursive2
);
61 var recursive3
= [recursive
];
62 recursive_value('array member contains self', recursive3
);