as-test 1.1.4 → 1.1.6-patch.1
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.
- package/CHANGELOG.md +24 -0
- package/assembly/__fuzz__/nested/array.fuzz.ts +13 -0
- package/bin/commands/build-core.js +27 -49
- package/bin/commands/fuzz-core.js +13 -53
- package/bin/commands/run-core.js +98 -99
- package/bin/commands/web-session.js +4 -0
- package/bin/crash-store.js +1 -1
- package/bin/index.js +37 -75
- package/bin/util.js +87 -6
- package/package.json +1 -1
- package/transform/lib/coverage.js +17 -16
- package/transform/lib/index.js +3 -1
- package/transform/lib/types.js +3 -0
- package/transform/lib/visitor.js +70 -67
package/transform/lib/visitor.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NodeKind } from "./types.js";
|
|
1
2
|
export class Visitor {
|
|
2
3
|
currentSource = null;
|
|
3
4
|
visit(node, ref = null) {
|
|
@@ -14,216 +15,218 @@ export class Visitor {
|
|
|
14
15
|
}
|
|
15
16
|
_visit(node, ref) {
|
|
16
17
|
switch (node.kind) {
|
|
17
|
-
case
|
|
18
|
+
case NodeKind.Source:
|
|
18
19
|
this.visitSource(node, ref);
|
|
19
20
|
break;
|
|
20
|
-
case
|
|
21
|
+
case NodeKind.NamedType:
|
|
21
22
|
this.visitNamedTypeNode(node, ref);
|
|
22
23
|
break;
|
|
23
|
-
case
|
|
24
|
+
case NodeKind.FunctionType:
|
|
24
25
|
this.visitFunctionTypeNode(node, ref);
|
|
25
26
|
break;
|
|
26
|
-
case
|
|
27
|
+
case NodeKind.TupleType:
|
|
28
|
+
break;
|
|
29
|
+
case NodeKind.TypeName:
|
|
27
30
|
this.visitTypeName(node, ref);
|
|
28
31
|
break;
|
|
29
|
-
case
|
|
32
|
+
case NodeKind.TypeParameter:
|
|
30
33
|
this.visitTypeParameter(node, ref);
|
|
31
34
|
break;
|
|
32
|
-
case
|
|
35
|
+
case NodeKind.Identifier:
|
|
33
36
|
this.visitIdentifierExpression(node, ref);
|
|
34
37
|
break;
|
|
35
|
-
case
|
|
38
|
+
case NodeKind.Assertion:
|
|
36
39
|
this.visitAssertionExpression(node, ref);
|
|
37
40
|
break;
|
|
38
|
-
case
|
|
41
|
+
case NodeKind.Binary:
|
|
39
42
|
this.visitBinaryExpression(node, ref);
|
|
40
43
|
break;
|
|
41
|
-
case
|
|
44
|
+
case NodeKind.Call:
|
|
42
45
|
this.visitCallExpression(node, ref);
|
|
43
46
|
break;
|
|
44
|
-
case
|
|
47
|
+
case NodeKind.Class:
|
|
45
48
|
this.visitClassExpression(node, ref);
|
|
46
49
|
break;
|
|
47
|
-
case
|
|
50
|
+
case NodeKind.Comma:
|
|
48
51
|
this.visitCommaExpression(node, ref);
|
|
49
52
|
break;
|
|
50
|
-
case
|
|
53
|
+
case NodeKind.ElementAccess:
|
|
51
54
|
this.visitElementAccessExpression(node, ref);
|
|
52
55
|
break;
|
|
53
|
-
case
|
|
56
|
+
case NodeKind.Function:
|
|
54
57
|
this.visitFunctionExpression(node, ref);
|
|
55
58
|
break;
|
|
56
|
-
case
|
|
59
|
+
case NodeKind.InstanceOf:
|
|
57
60
|
this.visitInstanceOfExpression(node, ref);
|
|
58
61
|
break;
|
|
59
|
-
case
|
|
62
|
+
case NodeKind.Literal:
|
|
60
63
|
this.visitLiteralExpression(node, ref);
|
|
61
64
|
break;
|
|
62
|
-
case
|
|
65
|
+
case NodeKind.New:
|
|
63
66
|
this.visitNewExpression(node, ref);
|
|
64
67
|
break;
|
|
65
|
-
case
|
|
68
|
+
case NodeKind.Parenthesized:
|
|
66
69
|
this.visitParenthesizedExpression(node, ref);
|
|
67
70
|
break;
|
|
68
|
-
case
|
|
71
|
+
case NodeKind.PropertyAccess:
|
|
69
72
|
this.visitPropertyAccessExpression(node, ref);
|
|
70
73
|
break;
|
|
71
|
-
case
|
|
74
|
+
case NodeKind.Ternary:
|
|
72
75
|
this.visitTernaryExpression(node, ref);
|
|
73
76
|
break;
|
|
74
|
-
case
|
|
77
|
+
case NodeKind.UnaryPostfix:
|
|
75
78
|
this.visitUnaryPostfixExpression(node, ref);
|
|
76
79
|
break;
|
|
77
|
-
case
|
|
80
|
+
case NodeKind.UnaryPrefix:
|
|
78
81
|
this.visitUnaryPrefixExpression(node, ref);
|
|
79
82
|
break;
|
|
80
|
-
case
|
|
83
|
+
case NodeKind.Block:
|
|
81
84
|
this.visitBlockStatement(node, ref);
|
|
82
85
|
break;
|
|
83
|
-
case
|
|
86
|
+
case NodeKind.Break:
|
|
84
87
|
this.visitBreakStatement(node, ref);
|
|
85
88
|
break;
|
|
86
|
-
case
|
|
89
|
+
case NodeKind.Continue:
|
|
87
90
|
this.visitContinueStatement(node, ref);
|
|
88
91
|
break;
|
|
89
|
-
case
|
|
92
|
+
case NodeKind.Do:
|
|
90
93
|
this.visitDoStatement(node, ref);
|
|
91
94
|
break;
|
|
92
|
-
case
|
|
95
|
+
case NodeKind.Empty:
|
|
93
96
|
this.visitEmptyStatement(node, ref);
|
|
94
97
|
break;
|
|
95
|
-
case
|
|
98
|
+
case NodeKind.Export:
|
|
96
99
|
this.visitExportStatement(node, ref);
|
|
97
100
|
break;
|
|
98
|
-
case
|
|
101
|
+
case NodeKind.ExportDefault:
|
|
99
102
|
this.visitExportDefaultStatement(node, ref);
|
|
100
103
|
break;
|
|
101
|
-
case
|
|
104
|
+
case NodeKind.ExportImport:
|
|
102
105
|
this.visitExportImportStatement(node, ref);
|
|
103
106
|
break;
|
|
104
|
-
case
|
|
107
|
+
case NodeKind.Expression:
|
|
105
108
|
this.visitExpressionStatement(node, ref);
|
|
106
109
|
break;
|
|
107
|
-
case
|
|
110
|
+
case NodeKind.For:
|
|
108
111
|
this.visitForStatement(node, ref);
|
|
109
112
|
break;
|
|
110
|
-
case
|
|
113
|
+
case NodeKind.If:
|
|
111
114
|
this.visitIfStatement(node, ref);
|
|
112
115
|
break;
|
|
113
|
-
case
|
|
116
|
+
case NodeKind.Import:
|
|
114
117
|
this.visitImportStatement(node, ref);
|
|
115
118
|
break;
|
|
116
|
-
case
|
|
119
|
+
case NodeKind.Return:
|
|
117
120
|
this.visitReturnStatement(node, ref);
|
|
118
121
|
break;
|
|
119
|
-
case
|
|
122
|
+
case NodeKind.Switch:
|
|
120
123
|
this.visitSwitchStatement(node, ref);
|
|
121
124
|
break;
|
|
122
|
-
case
|
|
125
|
+
case NodeKind.Throw:
|
|
123
126
|
this.visitThrowStatement(node, ref);
|
|
124
127
|
break;
|
|
125
|
-
case
|
|
128
|
+
case NodeKind.Try:
|
|
126
129
|
this.visitTryStatement(node, ref);
|
|
127
130
|
break;
|
|
128
|
-
case
|
|
131
|
+
case NodeKind.Variable:
|
|
129
132
|
this.visitVariableStatement(node, ref);
|
|
130
133
|
break;
|
|
131
|
-
case
|
|
134
|
+
case NodeKind.While:
|
|
132
135
|
this.visitWhileStatement(node, ref);
|
|
133
136
|
break;
|
|
134
|
-
case
|
|
137
|
+
case NodeKind.ClassDeclaration:
|
|
135
138
|
this.visitClassDeclaration(node, false, ref);
|
|
136
139
|
break;
|
|
137
|
-
case
|
|
140
|
+
case NodeKind.EnumDeclaration:
|
|
138
141
|
this.visitEnumDeclaration(node, false, ref);
|
|
139
142
|
break;
|
|
140
|
-
case
|
|
143
|
+
case NodeKind.EnumValueDeclaration:
|
|
141
144
|
this.visitEnumValueDeclaration(node, ref);
|
|
142
145
|
break;
|
|
143
|
-
case
|
|
146
|
+
case NodeKind.FieldDeclaration:
|
|
144
147
|
this.visitFieldDeclaration(node, ref);
|
|
145
148
|
break;
|
|
146
|
-
case
|
|
149
|
+
case NodeKind.FunctionDeclaration:
|
|
147
150
|
this.visitFunctionDeclaration(node, false, ref);
|
|
148
151
|
break;
|
|
149
|
-
case
|
|
152
|
+
case NodeKind.ImportDeclaration:
|
|
150
153
|
this.visitImportDeclaration(node, ref);
|
|
151
154
|
break;
|
|
152
|
-
case
|
|
155
|
+
case NodeKind.InterfaceDeclaration:
|
|
153
156
|
this.visitInterfaceDeclaration(node, false, ref);
|
|
154
157
|
break;
|
|
155
|
-
case
|
|
158
|
+
case NodeKind.MethodDeclaration:
|
|
156
159
|
this.visitMethodDeclaration(node, ref);
|
|
157
160
|
break;
|
|
158
|
-
case
|
|
161
|
+
case NodeKind.NamespaceDeclaration:
|
|
159
162
|
this.visitNamespaceDeclaration(node, false, ref);
|
|
160
163
|
break;
|
|
161
|
-
case
|
|
164
|
+
case NodeKind.TypeDeclaration:
|
|
162
165
|
this.visitTypeDeclaration(node, ref);
|
|
163
166
|
break;
|
|
164
|
-
case
|
|
167
|
+
case NodeKind.VariableDeclaration:
|
|
165
168
|
this.visitVariableDeclaration(node, ref);
|
|
166
169
|
break;
|
|
167
|
-
case
|
|
170
|
+
case NodeKind.Decorator:
|
|
168
171
|
this.visitDecoratorNode(node, ref);
|
|
169
172
|
break;
|
|
170
|
-
case
|
|
173
|
+
case NodeKind.ExportMember:
|
|
171
174
|
this.visitExportMember(node, ref);
|
|
172
175
|
break;
|
|
173
|
-
case
|
|
176
|
+
case NodeKind.SwitchCase:
|
|
174
177
|
this.visitSwitchCase(node, ref);
|
|
175
178
|
break;
|
|
176
|
-
case
|
|
179
|
+
case NodeKind.IndexSignature:
|
|
177
180
|
this.visitIndexSignature(node, ref);
|
|
178
181
|
break;
|
|
179
|
-
case
|
|
182
|
+
case NodeKind.Null:
|
|
180
183
|
this.visitNullExpression(node, ref);
|
|
181
184
|
break;
|
|
182
|
-
case
|
|
185
|
+
case NodeKind.True: {
|
|
183
186
|
this.visitTrueExpression(node, ref);
|
|
184
187
|
break;
|
|
185
188
|
}
|
|
186
|
-
case
|
|
189
|
+
case NodeKind.False: {
|
|
187
190
|
this.visitFalseExpression(node, ref);
|
|
188
191
|
break;
|
|
189
192
|
}
|
|
190
|
-
case
|
|
193
|
+
case NodeKind.Compiled: {
|
|
191
194
|
this.visitCompiledExpression(node, ref);
|
|
192
195
|
break;
|
|
193
196
|
}
|
|
194
|
-
case
|
|
197
|
+
case NodeKind.Constructor: {
|
|
195
198
|
this.visitConstructorExpression(node, ref);
|
|
196
199
|
break;
|
|
197
200
|
}
|
|
198
|
-
case
|
|
201
|
+
case NodeKind.Comment: {
|
|
199
202
|
this.visitComment(node, ref);
|
|
200
203
|
break;
|
|
201
204
|
}
|
|
202
|
-
case
|
|
205
|
+
case NodeKind.ForOf: {
|
|
203
206
|
this.visitForOfStatement(node, ref);
|
|
204
207
|
break;
|
|
205
208
|
}
|
|
206
|
-
case
|
|
209
|
+
case NodeKind.Module: {
|
|
207
210
|
this.visitModuleDeclaration(node, ref);
|
|
208
211
|
break;
|
|
209
212
|
}
|
|
210
|
-
case
|
|
213
|
+
case NodeKind.Omitted: {
|
|
211
214
|
this.visitOmittedExpression(node, ref);
|
|
212
215
|
break;
|
|
213
216
|
}
|
|
214
|
-
case
|
|
217
|
+
case NodeKind.Parameter: {
|
|
215
218
|
this.visitParameter(node, ref);
|
|
216
219
|
break;
|
|
217
220
|
}
|
|
218
|
-
case
|
|
221
|
+
case NodeKind.Super: {
|
|
219
222
|
this.visitSuperExpression(node, ref);
|
|
220
223
|
break;
|
|
221
224
|
}
|
|
222
|
-
case
|
|
225
|
+
case NodeKind.This: {
|
|
223
226
|
this.visitThisExpression(node, ref);
|
|
224
227
|
break;
|
|
225
228
|
}
|
|
226
|
-
case
|
|
229
|
+
case NodeKind.Void: {
|
|
227
230
|
this.visitVoidStatement(node, ref);
|
|
228
231
|
break;
|
|
229
232
|
}
|