This repository has been archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsvalue-protocol.txt
83 lines (68 loc) · 1.64 KB
/
jsvalue-protocol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Tracked objects are persisted in disk files. The opposite is called "untracked": they are
volatile, runtime-only objects not supposed to be persisted.
Inspected objects are objects that are inspected on the FE side via REPL or code browser.
For REPL it makes no difference what object to inspect, whether tracked or untracked. For
the code browser, tracked objects are laid out in a normal way, and untracked objects are
supposed to get inspected (same as in REPL). Presently we just display "new Object()" to
indicate an untracked value.
Serialization protocol for tracked objects, for persisting and code browsing:
{
type: 'function',
value: func.toString()
}
{
type: 'leaf',
// a string that is to be literally inserted in a REPL or module browser view.
// So this may be "null", "true", "undefined" or "\"JS string\"".
value: "/abc/"
}
{
type: 'object',
value: {
prop-0: val-0,
...
}
}
{
type: 'array',
value: [
val-0,
...
]
}
Serialization protocol for object inspection:
{
type: 'function',
id: 234,
value: func.toString()
}
{
type: 'leaf',
// A string that is to be literally inserted. So this may be "null", "true",
// "undefined" or "\"JS string\"".
value: "/abc/"
}
// For getters as lazily evaluated placeholders for real values of properties
{
type: 'unrevealed',
parentId: 234,
prop: "size"
}
{
type: 'object',
id: 234,
// only if serialization is deep
value: {
prop-0: val-0,
...
}
}
{
type: 'array',
id: 234,
// only if serialization is deep
value: [
val-0,
...
]
}