File: serialize.doctest

package info (click to toggle)
htmlunit-core-js 2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 5,804 kB
  • ctags: 10,088
  • sloc: java: 75,059; xml: 889; sh: 14; makefile: 11
file content (10 lines) | stat: -rw-r--r-- 287 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
js> var obj = { a:3, b:"hi", 9:"nine", 12:1200 };
js> serialize(obj, "foo.bin");
js> obj2 = deserialize("foo.bin");
[object Object]
js> uneval(obj)
({a:3, b:"hi", 9:"nine", 12:1200})
js> uneval(obj2)
({a:3, b:"hi", 9:"nine", 12:1200})
js> (new java.io.File("foo.bin"))["delete"]();
true