resin 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/amber/bin/amberc +10 -350
- data/amber/js/Benchfib.deploy.js +80 -89
- data/amber/js/Benchfib.js +80 -89
- data/amber/js/Canvas.deploy.js +558 -545
- data/amber/js/Canvas.js +563 -545
- data/amber/js/Compiler-AST.deploy.js +431 -243
- data/amber/js/Compiler-AST.js +487 -244
- data/amber/js/Compiler-Core.deploy.js +201 -1045
- data/amber/js/Compiler-Core.js +208 -1207
- data/amber/js/Compiler-Exceptions.deploy.js +37 -18
- data/amber/js/Compiler-Exceptions.js +42 -18
- data/amber/js/Compiler-IR.deploy.js +1071 -774
- data/amber/js/Compiler-IR.js +1194 -848
- data/amber/js/Compiler-Inlining.deploy.js +395 -373
- data/amber/js/Compiler-Inlining.js +395 -373
- data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
- data/amber/js/Compiler-Interpreter.js +1631 -0
- data/amber/js/Compiler-Semantic.deploy.js +695 -600
- data/amber/js/Compiler-Semantic.js +721 -611
- data/amber/js/Compiler-Tests.deploy.js +699 -376
- data/amber/js/Compiler-Tests.js +834 -381
- data/amber/js/Compiler.deploy.js +8563 -1805
- data/amber/js/Compiler.js +11476 -2633
- data/amber/js/Examples.deploy.js +29 -29
- data/amber/js/Examples.js +29 -29
- data/amber/js/IDE.deploy.js +3292 -2649
- data/amber/js/IDE.js +3318 -2710
- data/amber/js/Importer-Exporter.deploy.js +393 -349
- data/amber/js/Importer-Exporter.js +398 -354
- data/amber/js/Kernel-Announcements.deploy.js +53 -44
- data/amber/js/Kernel-Announcements.js +55 -44
- data/amber/js/Kernel-Classes.deploy.js +566 -368
- data/amber/js/Kernel-Classes.js +660 -402
- data/amber/js/Kernel-Collections.deploy.js +1149 -1098
- data/amber/js/Kernel-Collections.js +1183 -1116
- data/amber/js/Kernel-Exceptions.deploy.js +173 -75
- data/amber/js/Kernel-Exceptions.js +215 -77
- data/amber/js/Kernel-Methods.deploy.js +530 -313
- data/amber/js/Kernel-Methods.js +632 -338
- data/amber/js/Kernel-Objects.deploy.js +1734 -1577
- data/amber/js/Kernel-Objects.js +1867 -1654
- data/amber/js/Kernel-Tests.deploy.js +1416 -973
- data/amber/js/Kernel-Tests.js +1495 -981
- data/amber/js/Kernel-Transcript.deploy.js +23 -24
- data/amber/js/Kernel-Transcript.js +25 -26
- data/amber/js/SUnit-Tests.deploy.js +402 -0
- data/amber/js/SUnit-Tests.js +518 -0
- data/amber/js/SUnit.deploy.js +535 -237
- data/amber/js/SUnit.js +634 -246
- data/amber/js/amber.js +90 -53
- data/amber/js/boot.js +441 -255
- data/amber/js/init.js +1 -3
- data/amber/js/lib/CodeMirror/codemirror.css +3 -0
- data/amber/js/lib/CodeMirror/codemirror.js +104 -55
- data/amber/js/lib/peg-0.7.0.min.js +9 -0
- data/amber/js/parser.js +1504 -802
- data/amber/js/parser.pegjs +170 -165
- data/amber/st/Canvas.st +6 -0
- data/amber/st/Compiler-AST.st +54 -3
- data/amber/st/Compiler-Core.st +6 -551
- data/amber/st/Compiler-Exceptions.st +4 -0
- data/amber/st/Compiler-IR.st +205 -87
- data/amber/st/Compiler-Interpreter.st +597 -0
- data/amber/st/Compiler-Semantic.st +46 -21
- data/amber/st/Compiler-Tests.st +254 -7
- data/amber/st/Compiler.st +3172 -1541
- data/amber/st/IDE.st +57 -93
- data/amber/st/Importer-Exporter.st +4 -7
- data/amber/st/Kernel-Announcements.st +8 -0
- data/amber/st/Kernel-Classes.st +149 -40
- data/amber/st/Kernel-Collections.st +43 -32
- data/amber/st/Kernel-Exceptions.st +70 -1
- data/amber/st/Kernel-Methods.st +165 -27
- data/amber/st/Kernel-Objects.st +215 -140
- data/amber/st/Kernel-Tests.st +195 -10
- data/amber/st/Kernel-Transcript.st +1 -3
- data/amber/st/SUnit-Tests.st +186 -0
- data/amber/st/SUnit.st +186 -14
- data/bin/resin +6 -0
- data/lib/resin/cli.rb +19 -0
- metadata +41 -25
- data/amber/js/lib/peg-0.6.2.min.js +0 -2
- data/bin/resin-compile +0 -6
- data/bin/runresin +0 -12
@@ -6,7 +6,7 @@ smalltalk.method({
|
|
6
6
|
selector: "clear",
|
7
7
|
fn: function (){
|
8
8
|
var self=this;
|
9
|
-
return
|
9
|
+
return smalltalk.withContext(function($ctx1) {
|
10
10
|
}),
|
11
11
|
smalltalk.ConsoleTranscript);
|
12
12
|
|
@@ -16,7 +16,7 @@ smalltalk.method({
|
|
16
16
|
selector: "cr",
|
17
17
|
fn: function (){
|
18
18
|
var self=this;
|
19
|
-
return
|
19
|
+
return smalltalk.withContext(function($ctx1) {
|
20
20
|
}),
|
21
21
|
smalltalk.ConsoleTranscript);
|
22
22
|
|
@@ -26,7 +26,7 @@ smalltalk.method({
|
|
26
26
|
selector: "open",
|
27
27
|
fn: function (){
|
28
28
|
var self=this;
|
29
|
-
return
|
29
|
+
return smalltalk.withContext(function($ctx1) {
|
30
30
|
}),
|
31
31
|
smalltalk.ConsoleTranscript);
|
32
32
|
|
@@ -36,11 +36,8 @@ smalltalk.method({
|
|
36
36
|
selector: "show:",
|
37
37
|
fn: function (anObject){
|
38
38
|
var self=this;
|
39
|
-
|
40
|
-
|
41
|
-
console.log(String(string));
|
42
|
-
;
|
43
|
-
return self}
|
39
|
+
return smalltalk.withContext(function($ctx1) {
|
40
|
+
return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.ConsoleTranscript)})}
|
44
41
|
}),
|
45
42
|
smalltalk.ConsoleTranscript);
|
46
43
|
|
@@ -51,8 +48,8 @@ smalltalk.method({
|
|
51
48
|
selector: "initialize",
|
52
49
|
fn: function (){
|
53
50
|
var self=this;
|
54
|
-
smalltalk.
|
55
|
-
return self}
|
51
|
+
return smalltalk.withContext(function($ctx1) {
|
52
|
+
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ConsoleTranscript.klass)})}
|
56
53
|
}),
|
57
54
|
smalltalk.ConsoleTranscript.klass);
|
58
55
|
|
@@ -66,8 +63,8 @@ smalltalk.method({
|
|
66
63
|
selector: "clear",
|
67
64
|
fn: function (){
|
68
65
|
var self=this;
|
69
|
-
smalltalk.
|
70
|
-
return self}
|
66
|
+
return smalltalk.withContext(function($ctx1) {
|
67
|
+
return self}, function($ctx1) {$ctx1.fill(self,"clear",{}, smalltalk.Transcript.klass)})}
|
71
68
|
}),
|
72
69
|
smalltalk.Transcript.klass);
|
73
70
|
|
@@ -77,8 +74,8 @@ smalltalk.method({
|
|
77
74
|
selector: "cr",
|
78
75
|
fn: function (){
|
79
76
|
var self=this;
|
80
|
-
smalltalk.
|
81
|
-
return self}
|
77
|
+
return smalltalk.withContext(function($ctx1) {
|
78
|
+
return self}, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.Transcript.klass)})}
|
82
79
|
}),
|
83
80
|
smalltalk.Transcript.klass);
|
84
81
|
|
@@ -88,8 +85,10 @@ smalltalk.method({
|
|
88
85
|
selector: "current",
|
89
86
|
fn: function (){
|
90
87
|
var self=this;
|
91
|
-
return
|
92
|
-
|
88
|
+
return smalltalk.withContext(function($ctx1) {
|
89
|
+
$1=self["@current"];
|
90
|
+
return $1;
|
91
|
+
}, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.Transcript.klass)})}
|
93
92
|
}),
|
94
93
|
smalltalk.Transcript.klass);
|
95
94
|
|
@@ -99,8 +98,8 @@ smalltalk.method({
|
|
99
98
|
selector: "new",
|
100
99
|
fn: function (){
|
101
100
|
var self=this;
|
102
|
-
smalltalk.
|
103
|
-
return self}
|
101
|
+
return smalltalk.withContext(function($ctx1) {
|
102
|
+
return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Transcript.klass)})}
|
104
103
|
}),
|
105
104
|
smalltalk.Transcript.klass);
|
106
105
|
|
@@ -110,8 +109,8 @@ smalltalk.method({
|
|
110
109
|
selector: "open",
|
111
110
|
fn: function (){
|
112
111
|
var self=this;
|
113
|
-
smalltalk.
|
114
|
-
return self}
|
112
|
+
return smalltalk.withContext(function($ctx1) {
|
113
|
+
return self}, function($ctx1) {$ctx1.fill(self,"open",{}, smalltalk.Transcript.klass)})}
|
115
114
|
}),
|
116
115
|
smalltalk.Transcript.klass);
|
117
116
|
|
@@ -121,8 +120,8 @@ smalltalk.method({
|
|
121
120
|
selector: "register:",
|
122
121
|
fn: function (aTranscript){
|
123
122
|
var self=this;
|
124
|
-
|
125
|
-
return self}
|
123
|
+
return smalltalk.withContext(function($ctx1) {
|
124
|
+
return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript}, smalltalk.Transcript.klass)})}
|
126
125
|
}),
|
127
126
|
smalltalk.Transcript.klass);
|
128
127
|
|
@@ -132,8 +131,8 @@ smalltalk.method({
|
|
132
131
|
selector: "show:",
|
133
132
|
fn: function (anObject){
|
134
133
|
var self=this;
|
135
|
-
smalltalk.
|
136
|
-
return self}
|
134
|
+
return smalltalk.withContext(function($ctx1) {
|
135
|
+
return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.Transcript.klass)})}
|
137
136
|
}),
|
138
137
|
smalltalk.Transcript.klass);
|
139
138
|
|
@@ -7,7 +7,7 @@ selector: "clear",
|
|
7
7
|
category: 'printing',
|
8
8
|
fn: function (){
|
9
9
|
var self=this;
|
10
|
-
return
|
10
|
+
return smalltalk.withContext(function($ctx1) {
|
11
11
|
args: [],
|
12
12
|
source: "clear\x0a\x09\x22no op\x22",
|
13
13
|
messageSends: [],
|
@@ -22,7 +22,7 @@ selector: "cr",
|
|
22
22
|
category: 'printing',
|
23
23
|
fn: function (){
|
24
24
|
var self=this;
|
25
|
-
return
|
25
|
+
return smalltalk.withContext(function($ctx1) {
|
26
26
|
args: [],
|
27
27
|
source: "cr\x0a\x09\x22no op\x22",
|
28
28
|
messageSends: [],
|
@@ -37,7 +37,7 @@ selector: "open",
|
|
37
37
|
category: 'actions',
|
38
38
|
fn: function (){
|
39
39
|
var self=this;
|
40
|
-
return
|
40
|
+
return smalltalk.withContext(function($ctx1) {
|
41
41
|
args: [],
|
42
42
|
source: "open",
|
43
43
|
messageSends: [],
|
@@ -52,14 +52,11 @@ selector: "show:",
|
|
52
52
|
category: 'printing',
|
53
53
|
fn: function (anObject){
|
54
54
|
var self=this;
|
55
|
-
|
56
|
-
|
57
|
-
console.log(String(string));
|
58
|
-
;
|
59
|
-
return self},
|
55
|
+
return smalltalk.withContext(function($ctx1) {
|
56
|
+
return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.ConsoleTranscript)})},
|
60
57
|
args: ["anObject"],
|
61
|
-
source: "show: anObject\x0a\x09
|
62
|
-
messageSends: [
|
58
|
+
source: "show: anObject\x0a\x09<console.log(String(string._asString()))>",
|
59
|
+
messageSends: [],
|
63
60
|
referencedClasses: []
|
64
61
|
}),
|
65
62
|
smalltalk.ConsoleTranscript);
|
@@ -72,8 +69,8 @@ selector: "initialize",
|
|
72
69
|
category: 'initialization',
|
73
70
|
fn: function (){
|
74
71
|
var self=this;
|
75
|
-
smalltalk.
|
76
|
-
return self},
|
72
|
+
return smalltalk.withContext(function($ctx1) {
|
73
|
+
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ConsoleTranscript.klass)})},
|
77
74
|
args: [],
|
78
75
|
source: "initialize\x0a\x09Transcript register: self new",
|
79
76
|
messageSends: ["register:", "new"],
|
@@ -92,8 +89,8 @@ selector: "clear",
|
|
92
89
|
category: 'printing',
|
93
90
|
fn: function (){
|
94
91
|
var self=this;
|
95
|
-
smalltalk.
|
96
|
-
return self},
|
92
|
+
return smalltalk.withContext(function($ctx1) {
|
93
|
+
return self}, function($ctx1) {$ctx1.fill(self,"clear",{}, smalltalk.Transcript.klass)})},
|
97
94
|
args: [],
|
98
95
|
source: "clear\x0a self current clear",
|
99
96
|
messageSends: ["clear", "current"],
|
@@ -108,8 +105,8 @@ selector: "cr",
|
|
108
105
|
category: 'printing',
|
109
106
|
fn: function (){
|
110
107
|
var self=this;
|
111
|
-
smalltalk.
|
112
|
-
return self},
|
108
|
+
return smalltalk.withContext(function($ctx1) {
|
109
|
+
return self}, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.Transcript.klass)})},
|
113
110
|
args: [],
|
114
111
|
source: "cr\x0a self current show: String cr",
|
115
112
|
messageSends: ["show:", "cr", "current"],
|
@@ -124,8 +121,10 @@ selector: "current",
|
|
124
121
|
category: 'instance creation',
|
125
122
|
fn: function (){
|
126
123
|
var self=this;
|
127
|
-
return
|
128
|
-
|
124
|
+
return smalltalk.withContext(function($ctx1) {
|
125
|
+
$1=self["@current"];
|
126
|
+
return $1;
|
127
|
+
}, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.Transcript.klass)})},
|
129
128
|
args: [],
|
130
129
|
source: "current\x0a ^current",
|
131
130
|
messageSends: [],
|
@@ -140,8 +139,8 @@ selector: "new",
|
|
140
139
|
category: 'instance creation',
|
141
140
|
fn: function (){
|
142
141
|
var self=this;
|
143
|
-
smalltalk.
|
144
|
-
return self},
|
142
|
+
return smalltalk.withContext(function($ctx1) {
|
143
|
+
return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Transcript.klass)})},
|
145
144
|
args: [],
|
146
145
|
source: "new\x0a self shouldNotImplement",
|
147
146
|
messageSends: ["shouldNotImplement"],
|
@@ -156,8 +155,8 @@ selector: "open",
|
|
156
155
|
category: 'instance creation',
|
157
156
|
fn: function (){
|
158
157
|
var self=this;
|
159
|
-
smalltalk.
|
160
|
-
return self},
|
158
|
+
return smalltalk.withContext(function($ctx1) {
|
159
|
+
return self}, function($ctx1) {$ctx1.fill(self,"open",{}, smalltalk.Transcript.klass)})},
|
161
160
|
args: [],
|
162
161
|
source: "open\x0a self current open",
|
163
162
|
messageSends: ["open", "current"],
|
@@ -172,8 +171,8 @@ selector: "register:",
|
|
172
171
|
category: 'instance creation',
|
173
172
|
fn: function (aTranscript){
|
174
173
|
var self=this;
|
175
|
-
|
176
|
-
return self},
|
174
|
+
return smalltalk.withContext(function($ctx1) {
|
175
|
+
return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript}, smalltalk.Transcript.klass)})},
|
177
176
|
args: ["aTranscript"],
|
178
177
|
source: "register: aTranscript\x0a\x09current := aTranscript",
|
179
178
|
messageSends: [],
|
@@ -188,8 +187,8 @@ selector: "show:",
|
|
188
187
|
category: 'printing',
|
189
188
|
fn: function (anObject){
|
190
189
|
var self=this;
|
191
|
-
smalltalk.
|
192
|
-
return self},
|
190
|
+
return smalltalk.withContext(function($ctx1) {
|
191
|
+
return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.Transcript.klass)})},
|
193
192
|
args: ["anObject"],
|
194
193
|
source: "show: anObject\x0a self current show: anObject",
|
195
194
|
messageSends: ["show:", "current"],
|
@@ -0,0 +1,402 @@
|
|
1
|
+
smalltalk.addPackage('SUnit-Tests', {});
|
2
|
+
smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
"_setUp",
|
5
|
+
smalltalk.method({
|
6
|
+
selector: "setUp",
|
7
|
+
fn: function (){
|
8
|
+
var self=this;
|
9
|
+
return smalltalk.withContext(function($ctx1) {
|
10
|
+
self["@full"]=_st((smalltalk.Set || Set))._with_with_((5),smalltalk.symbolFor("abc"));
|
11
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.ExampleSetTest)})}
|
12
|
+
}),
|
13
|
+
smalltalk.ExampleSetTest);
|
14
|
+
|
15
|
+
smalltalk.addMethod(
|
16
|
+
"_testAdd",
|
17
|
+
smalltalk.method({
|
18
|
+
selector: "testAdd",
|
19
|
+
fn: function (){
|
20
|
+
var self=this;
|
21
|
+
return smalltalk.withContext(function($ctx1) {
|
22
|
+
_st(self)._assert_(_st(self["@empty"])._includes_((5)));
|
23
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAdd",{}, smalltalk.ExampleSetTest)})}
|
24
|
+
}),
|
25
|
+
smalltalk.ExampleSetTest);
|
26
|
+
|
27
|
+
smalltalk.addMethod(
|
28
|
+
"_testGrow",
|
29
|
+
smalltalk.method({
|
30
|
+
selector: "testGrow",
|
31
|
+
fn: function (){
|
32
|
+
var self=this;
|
33
|
+
return smalltalk.withContext(function($ctx1) {
|
34
|
+
_st(self)._assert_(_st(_st(self["@empty"])._size()).__eq((100)));
|
35
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{}, smalltalk.ExampleSetTest)})}
|
36
|
+
}),
|
37
|
+
smalltalk.ExampleSetTest);
|
38
|
+
|
39
|
+
smalltalk.addMethod(
|
40
|
+
"_testIllegal",
|
41
|
+
smalltalk.method({
|
42
|
+
selector: "testIllegal",
|
43
|
+
fn: function (){
|
44
|
+
var self=this;
|
45
|
+
return smalltalk.withContext(function($ctx1) {
|
46
|
+
return smalltalk.withContext(function($ctx2) {
|
47
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
48
|
+
_st(self)._should_raise_((function(){
|
49
|
+
return smalltalk.withContext(function($ctx2) {
|
50
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
51
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIllegal",{}, smalltalk.ExampleSetTest)})}
|
52
|
+
}),
|
53
|
+
smalltalk.ExampleSetTest);
|
54
|
+
|
55
|
+
smalltalk.addMethod(
|
56
|
+
"_testIncludes",
|
57
|
+
smalltalk.method({
|
58
|
+
selector: "testIncludes",
|
59
|
+
fn: function (){
|
60
|
+
var self=this;
|
61
|
+
return smalltalk.withContext(function($ctx1) {
|
62
|
+
_st(self)._assert_(_st(self["@full"])._includes_(smalltalk.symbolFor("abc")));
|
63
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIncludes",{}, smalltalk.ExampleSetTest)})}
|
64
|
+
}),
|
65
|
+
smalltalk.ExampleSetTest);
|
66
|
+
|
67
|
+
smalltalk.addMethod(
|
68
|
+
"_testOccurrences",
|
69
|
+
smalltalk.method({
|
70
|
+
selector: "testOccurrences",
|
71
|
+
fn: function (){
|
72
|
+
var self=this;
|
73
|
+
return smalltalk.withContext(function($ctx1) {
|
74
|
+
_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
|
75
|
+
_st(self["@full"])._add_((5));
|
76
|
+
_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
|
77
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{}, smalltalk.ExampleSetTest)})}
|
78
|
+
}),
|
79
|
+
smalltalk.ExampleSetTest);
|
80
|
+
|
81
|
+
smalltalk.addMethod(
|
82
|
+
"_testRemove",
|
83
|
+
smalltalk.method({
|
84
|
+
selector: "testRemove",
|
85
|
+
fn: function (){
|
86
|
+
var self=this;
|
87
|
+
return smalltalk.withContext(function($ctx1) {
|
88
|
+
_st(self)._assert_(_st(self["@full"])._includes_(smalltalk.symbolFor("abc")));
|
89
|
+
_st(self)._deny_(_st(self["@full"])._includes_((5)));
|
90
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testRemove",{}, smalltalk.ExampleSetTest)})}
|
91
|
+
}),
|
92
|
+
smalltalk.ExampleSetTest);
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
smalltalk.addClass('SUnitAsyncTest', smalltalk.TestCase, ['flag'], 'SUnit-Tests');
|
97
|
+
smalltalk.addMethod(
|
98
|
+
"_fakeError",
|
99
|
+
smalltalk.method({
|
100
|
+
selector: "fakeError",
|
101
|
+
fn: function (){
|
102
|
+
var self=this;
|
103
|
+
return smalltalk.withContext(function($ctx1) {
|
104
|
+
_st(self)._timeout_((10));
|
105
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
106
|
+
return smalltalk.withContext(function($ctx2) {
|
107
|
+
self["@flag"];
|
108
|
+
return _st(self)._error_("Intentional");
|
109
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
110
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeError",{}, smalltalk.SUnitAsyncTest)})}
|
111
|
+
}),
|
112
|
+
smalltalk.SUnitAsyncTest);
|
113
|
+
|
114
|
+
smalltalk.addMethod(
|
115
|
+
"_fakeErrorFailingInTearDown",
|
116
|
+
smalltalk.method({
|
117
|
+
selector: "fakeErrorFailingInTearDown",
|
118
|
+
fn: function (){
|
119
|
+
var self=this;
|
120
|
+
return smalltalk.withContext(function($ctx1) {
|
121
|
+
_st(self)._timeout_((10));
|
122
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
123
|
+
return smalltalk.withContext(function($ctx2) {
|
124
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
125
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeErrorFailingInTearDown",{}, smalltalk.SUnitAsyncTest)})}
|
126
|
+
}),
|
127
|
+
smalltalk.SUnitAsyncTest);
|
128
|
+
|
129
|
+
smalltalk.addMethod(
|
130
|
+
"_fakeFailure",
|
131
|
+
smalltalk.method({
|
132
|
+
selector: "fakeFailure",
|
133
|
+
fn: function (){
|
134
|
+
var self=this;
|
135
|
+
return smalltalk.withContext(function($ctx1) {
|
136
|
+
_st(self)._timeout_((10));
|
137
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
138
|
+
return smalltalk.withContext(function($ctx2) {
|
139
|
+
self["@flag"];
|
140
|
+
return _st(self)._assert_(false);
|
141
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
142
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeFailure",{}, smalltalk.SUnitAsyncTest)})}
|
143
|
+
}),
|
144
|
+
smalltalk.SUnitAsyncTest);
|
145
|
+
|
146
|
+
smalltalk.addMethod(
|
147
|
+
"_fakeMultipleTimeoutFailing",
|
148
|
+
smalltalk.method({
|
149
|
+
selector: "fakeMultipleTimeoutFailing",
|
150
|
+
fn: function (){
|
151
|
+
var self=this;
|
152
|
+
return smalltalk.withContext(function($ctx1) {
|
153
|
+
_st(_st(self)._async_((function(){
|
154
|
+
return smalltalk.withContext(function($ctx2) {
|
155
|
+
return _st(_st(self)._async_((function(){
|
156
|
+
return smalltalk.withContext(function($ctx3) {
|
157
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._valueWithTimeout_((10));
|
158
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
159
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutFailing",{}, smalltalk.SUnitAsyncTest)})}
|
160
|
+
}),
|
161
|
+
smalltalk.SUnitAsyncTest);
|
162
|
+
|
163
|
+
smalltalk.addMethod(
|
164
|
+
"_fakeMultipleTimeoutPassing",
|
165
|
+
smalltalk.method({
|
166
|
+
selector: "fakeMultipleTimeoutPassing",
|
167
|
+
fn: function (){
|
168
|
+
var self=this;
|
169
|
+
return smalltalk.withContext(function($ctx1) {
|
170
|
+
_st(_st(self)._async_((function(){
|
171
|
+
return smalltalk.withContext(function($ctx2) {
|
172
|
+
return _st(_st(self)._async_((function(){
|
173
|
+
return smalltalk.withContext(function($ctx3) {
|
174
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._valueWithTimeout_((10));
|
175
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
176
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutPassing",{}, smalltalk.SUnitAsyncTest)})}
|
177
|
+
}),
|
178
|
+
smalltalk.SUnitAsyncTest);
|
179
|
+
|
180
|
+
smalltalk.addMethod(
|
181
|
+
"_fakeTimeout",
|
182
|
+
smalltalk.method({
|
183
|
+
selector: "fakeTimeout",
|
184
|
+
fn: function (){
|
185
|
+
var self=this;
|
186
|
+
return smalltalk.withContext(function($ctx1) {
|
187
|
+
_st(_st(self)._async_((function(){
|
188
|
+
return smalltalk.withContext(function($ctx2) {
|
189
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
190
|
+
return self}, function($ctx1) {$ctx1.fill(self,"fakeTimeout",{}, smalltalk.SUnitAsyncTest)})}
|
191
|
+
}),
|
192
|
+
smalltalk.SUnitAsyncTest);
|
193
|
+
|
194
|
+
smalltalk.addMethod(
|
195
|
+
"_setUp",
|
196
|
+
smalltalk.method({
|
197
|
+
selector: "setUp",
|
198
|
+
fn: function (){
|
199
|
+
var self=this;
|
200
|
+
return smalltalk.withContext(function($ctx1) {
|
201
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.SUnitAsyncTest)})}
|
202
|
+
}),
|
203
|
+
smalltalk.SUnitAsyncTest);
|
204
|
+
|
205
|
+
smalltalk.addMethod(
|
206
|
+
"_sortedSelectors_",
|
207
|
+
smalltalk.method({
|
208
|
+
selector: "sortedSelectors:",
|
209
|
+
fn: function (aCollection){
|
210
|
+
var self=this;
|
211
|
+
return smalltalk.withContext(function($ctx1) {
|
212
|
+
$1=_st(_st(aCollection)._collect_((function(each){
|
213
|
+
return smalltalk.withContext(function($ctx2) {
|
214
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._sorted();
|
215
|
+
return $1;
|
216
|
+
}, function($ctx1) {$ctx1.fill(self,"sortedSelectors:",{aCollection:aCollection}, smalltalk.SUnitAsyncTest)})}
|
217
|
+
}),
|
218
|
+
smalltalk.SUnitAsyncTest);
|
219
|
+
|
220
|
+
smalltalk.addMethod(
|
221
|
+
"_tearDown",
|
222
|
+
smalltalk.method({
|
223
|
+
selector: "tearDown",
|
224
|
+
fn: function (){
|
225
|
+
var self=this;
|
226
|
+
return smalltalk.withContext(function($ctx1) {
|
227
|
+
return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{}, smalltalk.SUnitAsyncTest)})}
|
228
|
+
}),
|
229
|
+
smalltalk.SUnitAsyncTest);
|
230
|
+
|
231
|
+
smalltalk.addMethod(
|
232
|
+
"_testAsyncErrorsAndFailures",
|
233
|
+
smalltalk.method({
|
234
|
+
selector: "testAsyncErrorsAndFailures",
|
235
|
+
fn: function (){
|
236
|
+
var self=this;
|
237
|
+
var suite,runner,result,assertBlock;
|
238
|
+
return smalltalk.withContext(function($ctx1) {
|
239
|
+
suite=_st(["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"])._collect_((function(each){
|
240
|
+
return smalltalk.withContext(function($ctx2) {
|
241
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
242
|
+
runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
|
243
|
+
_st(self)._timeout_((200));
|
244
|
+
result=_st(runner)._result();
|
245
|
+
assertBlock=_st(self)._async_((function(){
|
246
|
+
return smalltalk.withContext(function($ctx2) {
|
247
|
+
_st(self)._assert_equals_(["fakeErrorFailingInTearDown", "fakeFailure"],_st(self)._sortedSelectors_(_st(result)._failures()));
|
248
|
+
return _st(self)._finished();
|
249
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
250
|
+
$1=_st(runner)._announcer();
|
251
|
+
$2=(smalltalk.ResultAnnouncement || ResultAnnouncement);
|
252
|
+
$3=(function(ann){
|
253
|
+
return smalltalk.withContext(function($ctx2) {
|
254
|
+
$5=(function(){
|
255
|
+
return smalltalk.withContext(function($ctx3) {
|
256
|
+
return _st($6)._ifTrue_(assertBlock);
|
257
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
|
258
|
+
return _st($4)._ifTrue_($5);
|
259
|
+
}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})});
|
260
|
+
_st($1)._on_do_($2,$3);
|
261
|
+
_st(runner)._run();
|
262
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsyncErrorsAndFailures",{suite:suite,runner:runner,result:result,assertBlock:assertBlock}, smalltalk.SUnitAsyncTest)})}
|
263
|
+
}),
|
264
|
+
smalltalk.SUnitAsyncTest);
|
265
|
+
|
266
|
+
smalltalk.addMethod(
|
267
|
+
"_testAsyncNeedsTimeout",
|
268
|
+
smalltalk.method({
|
269
|
+
selector: "testAsyncNeedsTimeout",
|
270
|
+
fn: function (){
|
271
|
+
var self=this;
|
272
|
+
return smalltalk.withContext(function($ctx1) {
|
273
|
+
return smalltalk.withContext(function($ctx2) {
|
274
|
+
return smalltalk.withContext(function($ctx3) {
|
275
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
276
|
+
_st(self)._timeout_((0));
|
277
|
+
_st(self)._shouldnt_raise_((function(){
|
278
|
+
return smalltalk.withContext(function($ctx2) {
|
279
|
+
return smalltalk.withContext(function($ctx3) {
|
280
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
281
|
+
_st(self)._finished();
|
282
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsyncNeedsTimeout",{}, smalltalk.SUnitAsyncTest)})}
|
283
|
+
}),
|
284
|
+
smalltalk.SUnitAsyncTest);
|
285
|
+
|
286
|
+
smalltalk.addMethod(
|
287
|
+
"_testFinishedNeedsTimeout",
|
288
|
+
smalltalk.method({
|
289
|
+
selector: "testFinishedNeedsTimeout",
|
290
|
+
fn: function (){
|
291
|
+
var self=this;
|
292
|
+
return smalltalk.withContext(function($ctx1) {
|
293
|
+
return smalltalk.withContext(function($ctx2) {
|
294
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
295
|
+
_st(self)._timeout_((0));
|
296
|
+
_st(self)._shouldnt_raise_((function(){
|
297
|
+
return smalltalk.withContext(function($ctx2) {
|
298
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
299
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testFinishedNeedsTimeout",{}, smalltalk.SUnitAsyncTest)})}
|
300
|
+
}),
|
301
|
+
smalltalk.SUnitAsyncTest);
|
302
|
+
|
303
|
+
smalltalk.addMethod(
|
304
|
+
"_testIsAsyncReturnsCorrectValues",
|
305
|
+
smalltalk.method({
|
306
|
+
selector: "testIsAsyncReturnsCorrectValues",
|
307
|
+
fn: function (){
|
308
|
+
var self=this;
|
309
|
+
return smalltalk.withContext(function($ctx1) {
|
310
|
+
_st(self)._timeout_((0));
|
311
|
+
_st(self)._assert_(_st(self)._isAsync());
|
312
|
+
_st(self)._finished();
|
313
|
+
_st(self)._deny_(_st(self)._isAsync());
|
314
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIsAsyncReturnsCorrectValues",{}, smalltalk.SUnitAsyncTest)})}
|
315
|
+
}),
|
316
|
+
smalltalk.SUnitAsyncTest);
|
317
|
+
|
318
|
+
smalltalk.addMethod(
|
319
|
+
"_testPass",
|
320
|
+
smalltalk.method({
|
321
|
+
selector: "testPass",
|
322
|
+
fn: function (){
|
323
|
+
var self=this;
|
324
|
+
return smalltalk.withContext(function($ctx1) {
|
325
|
+
_st(self)._timeout_((10));
|
326
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
327
|
+
return smalltalk.withContext(function($ctx2) {
|
328
|
+
_st(self)._finished();
|
329
|
+
self["@flag"]="ok";
|
330
|
+
return self["@flag"];
|
331
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
|
332
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPass",{}, smalltalk.SUnitAsyncTest)})}
|
333
|
+
}),
|
334
|
+
smalltalk.SUnitAsyncTest);
|
335
|
+
|
336
|
+
smalltalk.addMethod(
|
337
|
+
"_testTimeouts",
|
338
|
+
smalltalk.method({
|
339
|
+
selector: "testTimeouts",
|
340
|
+
fn: function (){
|
341
|
+
var self=this;
|
342
|
+
var suite,runner,result,assertBlock;
|
343
|
+
return smalltalk.withContext(function($ctx1) {
|
344
|
+
suite=_st(["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"])._collect_((function(each){
|
345
|
+
return smalltalk.withContext(function($ctx2) {
|
346
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
347
|
+
runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
|
348
|
+
_st(self)._timeout_((200));
|
349
|
+
result=_st(runner)._result();
|
350
|
+
assertBlock=_st(self)._async_((function(){
|
351
|
+
return smalltalk.withContext(function($ctx2) {
|
352
|
+
_st(self)._assert_equals_(["fakeMultipleTimeoutFailing", "fakeTimeout"],_st(self)._sortedSelectors_(_st(result)._failures()));
|
353
|
+
return _st(self)._finished();
|
354
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
355
|
+
$1=_st(runner)._announcer();
|
356
|
+
$2=(smalltalk.ResultAnnouncement || ResultAnnouncement);
|
357
|
+
$3=(function(ann){
|
358
|
+
return smalltalk.withContext(function($ctx2) {
|
359
|
+
$5=(function(){
|
360
|
+
return smalltalk.withContext(function($ctx3) {
|
361
|
+
return _st($6)._ifTrue_(assertBlock);
|
362
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
|
363
|
+
return _st($4)._ifTrue_($5);
|
364
|
+
}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})});
|
365
|
+
_st($1)._on_do_($2,$3);
|
366
|
+
_st(runner)._run();
|
367
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTimeouts",{suite:suite,runner:runner,result:result,assertBlock:assertBlock}, smalltalk.SUnitAsyncTest)})}
|
368
|
+
}),
|
369
|
+
smalltalk.SUnitAsyncTest);
|
370
|
+
|
371
|
+
smalltalk.addMethod(
|
372
|
+
"_testTwoAsyncPassesWithFinishedOnlyOneIsRun",
|
373
|
+
smalltalk.method({
|
374
|
+
selector: "testTwoAsyncPassesWithFinishedOnlyOneIsRun",
|
375
|
+
fn: function (){
|
376
|
+
var self=this;
|
377
|
+
var x;
|
378
|
+
return smalltalk.withContext(function($ctx1) {
|
379
|
+
_st(self)._timeout_((10));
|
380
|
+
x=(0);
|
381
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
382
|
+
return smalltalk.withContext(function($ctx2) {
|
383
|
+
self["@flag"]="ok";
|
384
|
+
self["@flag"];
|
385
|
+
x=_st(x).__plus((1));
|
386
|
+
x;
|
387
|
+
return _st(self)._assert_equals_((1),x);
|
388
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
|
389
|
+
self["@flag"]=_st(_st(self)._async_((function(){
|
390
|
+
return smalltalk.withContext(function($ctx2) {
|
391
|
+
self["@flag"]="ok";
|
392
|
+
self["@flag"];
|
393
|
+
x=_st(x).__plus((1));
|
394
|
+
x;
|
395
|
+
return _st(self)._assert_equals_((1),x);
|
396
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
|
397
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x}, smalltalk.SUnitAsyncTest)})}
|
398
|
+
}),
|
399
|
+
smalltalk.SUnitAsyncTest);
|
400
|
+
|
401
|
+
|
402
|
+
|