/
sandbox.js
84 lines (68 loc) · 1.72 KB
/
sandbox.js
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
84
var log = "";
light(function () {
this.system.startRecording();
});
light.handle("addOne", function (definition) {
});
//0
light.service("doubler", function (arg) {
log += ",0";
return arg * 2;
});
//1
light.receive("message", function (message) {
log += ",1";
var data1 = this.store.get("arg");
console.log(data1);
this.store.set("arg", 100)
var data2 = this.store.get("arg");
console.log(data2);
console.log(this.arg);
// return this.service().doubler(message);
});
//2
light.receive("message", function (message) {
log += ",2";
var data1 = this.store.get("arg");
console.log(data1);
this.store.set("arg", 200)
var data2 = this.store.get("arg");
console.log(data2);
console.log(this.arg);
return this.service().doubler(message);
});
//3
light(function () {
var data1 = this.store.get("arg");
console.log(data1);
this.store.set("arg", 100)
var data2 = this.store.get("arg");
console.log(data2);
console.log(this.arg);
var data3 = light.send("message", 123);
console.log(data3);
});
//4
light(function () {
var data1 = this.store.get("arg");
console.log(data1);
this.store.set("arg", 200)
var data2 = this.store.get("arg");
console.log(data2);
console.log(this.arg);
var data3 = light.send("message", 456);
console.log(data3);
});
light(function () {
this.system.stopRecording();
});
light(function () {
log += "|";
this.service().timemachine_last();
this.service().timemachine_previous();
this.service().timemachine_previous();
this.service().timemachine_previous();
this.service().timemachine_previous();
this.service().timemachine_previous();
console.log(log);
});