Debian Codegraph @

rhino/testsrc/doctests/serialize.doctest

raw
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 js> var obj = { a:3, b:"hi", 9:"nine", 12:1200 };
6 js> serialize(obj, "foo.bin");
7 js> obj2 = deserialize("foo.bin");
8 [object Object]
9 js> uneval(obj)
10 ({a:3, b:"hi", 9:"nine", 12:1200})
11 js> uneval(obj2)
12 ({a:3, b:"hi", 9:"nine", 12:1200})
13 js> (new java.io.File("foo.bin"))["delete"]();
14 true