json-as 0.9.15 → 0.9.17

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 CHANGED
@@ -23,6 +23,8 @@ v0.9.12 - Add compat with aspect
23
23
  v0.9.13 - Fix empty strings not indexing correctly
24
24
  v0.9.14 - Ignore properties of type Function
25
25
  v0.9.15 - Support JSON.Raw blocks
26
+ v0.9.16 - JSON.Raw should be completely untouched
27
+ v0.9.17 - A schema's parent's fields should be included properly
26
28
 
27
29
  [UNRELEASED] v1.0.0
28
30
  - Allow nullable primitives
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  __| || __|| || | | ___ | _ || __|
4
4
  | | ||__ || | || | | ||___|| ||__ |
5
5
  |_____||_____||_____||_|___| |__|__||_____|
6
- v0.9.15
6
+ v0.9.17
7
7
  </pre>
8
8
  </h5>
9
9
 
package/assembly/test.ts CHANGED
@@ -1,33 +1,28 @@
1
1
  // import { JSON } from ".";
2
2
  import { JSON } from ".";
3
3
  @json
4
- class Vec3 {
5
- x: f32 = 0.0;
6
- y: f32 = 0.0;
7
- z: f32 = 0.0;
4
+ class Message {
5
+ constructor(role: string, content: string) {
6
+ this._role = role;
7
+ this.content = content;
8
+ }
9
+
10
+
11
+ @alias("role")
12
+ protected _role: string;
13
+
14
+ get role(): string {
15
+ return this._role;
16
+ }
17
+
18
+ content: string;
8
19
  }
9
20
 
10
21
  @json
11
- class Player {
12
- firstName!: string;
13
- lastName!: string;
14
- lastActive!: i32[];
15
- age!: i32;
16
- pos!: JSON.Raw;
17
- isVerified!: boolean;
22
+ class UserMessage extends Message {
23
+ constructor(content: string) {
24
+ super("user", content);
25
+ }
18
26
  }
19
-
20
- const player: Player = {
21
- firstName: "Emmet",
22
- lastName: "West",
23
- lastActive: [8, 27, 2022],
24
- age: 23,
25
- pos: "{\"x\":3.4,\"y\":1.2,\"z\":8.3}",
26
- isVerified: true
27
- };
28
-
29
- const stringified = JSON.stringify<Player>(player);
30
- console.log(stringified);
31
- console.log(idof<JSON.Raw>().toString());
32
- console.log(idof<string>().toString())
33
- // const parsed = JSON.parse<Player>(stringified);
27
+ console.log(JSON.stringify(new Message("user", "foo")))
28
+ console.log(JSON.stringify(new UserMessage("foo")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-as",
3
- "version": "0.9.15",
3
+ "version": "0.9.17",
4
4
  "description": "The only JSON library you'll need for AssemblyScript. SIMD enabled",
5
5
  "types": "assembly/index.ts",
6
6
  "author": "Jairus Tanaka",
@@ -31,10 +31,11 @@ class JSONTransform extends BaseVisitor {
31
31
  if (node.extendsType) {
32
32
  schema.parent = this.schemasList.find((v) => v.name == node.extendsType?.name.identifier.text);
33
33
  if (schema.parent?.members) {
34
- for (let i = 0; i < schema.parent.members.length; i++) {
34
+ for (let i = schema.parent.members.length - 1; i >= 0; i--) {
35
35
  const replace = schema.members.find((v) => v.name == schema.parent?.members[i]?.name);
36
36
  if (!replace) {
37
- schema.members.unshift(schema.parent.members[i]);
37
+ //schema.members.unshift(schema.parent?.members[i]!);
38
+ members.unshift(schema.parent?.members[i].node);
38
39
  }
39
40
  }
40
41
  }
@@ -118,8 +119,8 @@ class JSONTransform extends BaseVisitor {
118
119
  if (!mem.flags.length) {
119
120
  mem.flags = [PropertyFlags.None];
120
121
  if (type == "JSON.Raw") {
121
- mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${__SERIALIZE<string>(this." + name.text + ")}";
122
- mem.deserialize = "this." + name.text + " = " + "__DESERIALIZE<string>(data.substring(value_start, value_end));";
122
+ mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${this." + name.text + "}";
123
+ mem.deserialize = "this." + name.text + " = " + "data.substring(value_start, value_end);";
123
124
  }
124
125
  else {
125
126
  mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${__SERIALIZE<" + type + ">(this." + name.text + ")}";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-as/transform",
3
- "version": "0.9.15",
3
+ "version": "0.9.17",
4
4
  "description": "The only JSON library you'll need for AssemblyScript. SIMD enabled",
5
5
  "main": "./lib/index.js",
6
6
  "author": "Jairus Tanaka",
@@ -48,12 +48,13 @@ class JSONTransform extends BaseVisitor {
48
48
  ) as SchemaData | null;
49
49
 
50
50
  if (schema.parent?.members) {
51
- for (let i = 0; i < schema.parent.members.length; i++) {
51
+ for (let i = schema.parent.members.length - 1; i >= 0; i--) {
52
52
  const replace = schema.members.find(
53
53
  (v) => v.name == schema.parent?.members[i]?.name
54
54
  );
55
55
  if (!replace) {
56
- schema.members.unshift(schema.parent.members[i]!);
56
+ //schema.members.unshift(schema.parent?.members[i]!);
57
+ members.unshift(schema.parent?.members[i]!.node);
57
58
  }
58
59
  }
59
60
  }
@@ -136,8 +137,8 @@ class JSONTransform extends BaseVisitor {
136
137
  if (!mem.flags.length) {
137
138
  mem.flags = [PropertyFlags.None];
138
139
  if (type == "JSON.Raw") {
139
- mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${__SERIALIZE<string>(this." + name.text + ")}";
140
- mem.deserialize = "this." + name.text + " = " + "__DESERIALIZE<string>(data.substring(value_start, value_end));"
140
+ mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${this." + name.text + "}";
141
+ mem.deserialize = "this." + name.text + " = " + "data.substring(value_start, value_end);"
141
142
  } else {
142
143
  mem.serialize = escapeString(JSON.stringify(mem.alias || mem.name)) + ":${__SERIALIZE<" + type + ">(this." + name.text + ")}";
143
144
  mem.deserialize = "this." + name.text + " = " + "__DESERIALIZE<" + type + ">(data.substring(value_start, value_end));"
@@ -1,516 +0,0 @@
1
- import { ArrayLiteralExpression, AssertionExpression, BinaryExpression, CallExpression, ElementAccessExpression, FloatLiteralExpression, FunctionTypeNode, IdentifierExpression, NamedTypeNode, Node, ObjectLiteralExpression, Source, TypeParameterNode, BlockStatement, BreakStatement, ClassDeclaration, ClassExpression, CommaExpression, ContinueStatement, DecoratorNode, DoStatement, EmptyStatement, EnumDeclaration, EnumValueDeclaration, ExportDefaultStatement, ExportImportStatement, ExportMember, ExportStatement, ExpressionStatement, FieldDeclaration, ForStatement, FunctionDeclaration, FunctionExpression, IfStatement, ImportDeclaration, ImportStatement, IndexSignatureNode, InstanceOfExpression, IntegerLiteralExpression, InterfaceDeclaration, LiteralExpression, MethodDeclaration, NamespaceDeclaration, NewExpression, ParameterNode, ParenthesizedExpression, PropertyAccessExpression, RegexpLiteralExpression, ReturnStatement, StringLiteralExpression, SwitchCase, SwitchStatement, TemplateLiteralExpression, TernaryExpression, ThrowStatement, TryStatement, TypeDeclaration, TypeName, UnaryPostfixExpression, UnaryPrefixExpression, VariableDeclaration, VariableStatement, WhileStatement, } from "assemblyscript/dist/assemblyscript.js";
2
- export class Visitor {
3
- constructor() {
4
- this.currentSource = null;
5
- this.depth = 0;
6
- }
7
- visit(node) {
8
- if (node == null) {
9
- return;
10
- }
11
- else if (node instanceof Array) {
12
- for (const element of node) {
13
- this.visit(element);
14
- }
15
- }
16
- else if (node instanceof Map) {
17
- for (const element of node.values()) {
18
- this.visit(element);
19
- }
20
- // @ts-ignore
21
- }
22
- else if (typeof node[Symbol.iterator] === "function") {
23
- // @ts-ignore
24
- for (const element of node) {
25
- this.visit(element);
26
- }
27
- }
28
- else if (node instanceof Node) {
29
- this._visit(node);
30
- }
31
- else {
32
- throw new Error("Could not visit invalid type!");
33
- }
34
- }
35
- _visit(node) {
36
- if (node instanceof Source) {
37
- this.visitSource(node);
38
- }
39
- else if (node instanceof NamedTypeNode) {
40
- this.visitNamedTypeNode(node);
41
- }
42
- else if (node instanceof FunctionTypeNode) {
43
- this.visitFunctionTypeNode(node);
44
- }
45
- else if (node instanceof TypeName) {
46
- this.visitTypeName(node);
47
- }
48
- else if (node instanceof TypeParameterNode) {
49
- this.visitTypeParameter(node);
50
- }
51
- else if (node instanceof IdentifierExpression) {
52
- this.visitIdentifierExpression(node);
53
- }
54
- else if (node instanceof AssertionExpression) {
55
- this.visitAssertionExpression(node);
56
- }
57
- else if (node instanceof BinaryExpression) {
58
- this.visitBinaryExpression(node);
59
- }
60
- else if (node instanceof CallExpression) {
61
- this.visitCallExpression(node);
62
- }
63
- else if (node instanceof ClassExpression) {
64
- this.visitClassExpression(node);
65
- }
66
- else if (node instanceof CommaExpression) {
67
- this.visitCommaExpression(node);
68
- }
69
- else if (node instanceof ElementAccessExpression) {
70
- this.visitElementAccessExpression(node);
71
- }
72
- else if (node instanceof FunctionExpression) {
73
- this.visitFunctionExpression(node);
74
- }
75
- else if (node instanceof InstanceOfExpression) {
76
- this.visitInstanceOfExpression(node);
77
- }
78
- else if (node instanceof LiteralExpression) {
79
- this.visitLiteralExpression(node);
80
- }
81
- else if (node instanceof NewExpression) {
82
- this.visitNewExpression(node);
83
- }
84
- else if (node instanceof ParenthesizedExpression) {
85
- this.visitParenthesizedExpression(node);
86
- }
87
- else if (node instanceof PropertyAccessExpression) {
88
- this.visitPropertyAccessExpression(node);
89
- }
90
- else if (node instanceof TernaryExpression) {
91
- this.visitTernaryExpression(node);
92
- }
93
- else if (node instanceof UnaryPostfixExpression) {
94
- this.visitUnaryPostfixExpression(node);
95
- }
96
- else if (node instanceof UnaryPrefixExpression) {
97
- this.visitUnaryPrefixExpression(node);
98
- }
99
- else if (node instanceof BlockStatement) {
100
- this.visitBlockStatement(node);
101
- }
102
- else if (node instanceof BreakStatement) {
103
- this.visitBreakStatement(node);
104
- }
105
- else if (node instanceof ContinueStatement) {
106
- this.visitContinueStatement(node);
107
- }
108
- else if (node instanceof DoStatement) {
109
- this.visitDoStatement(node);
110
- }
111
- else if (node instanceof EmptyStatement) {
112
- this.visitEmptyStatement(node);
113
- }
114
- else if (node instanceof ExportStatement) {
115
- this.visitExportStatement(node);
116
- }
117
- else if (node instanceof ExportDefaultStatement) {
118
- this.visitExportDefaultStatement(node);
119
- }
120
- else if (node instanceof ExportImportStatement) {
121
- this.visitExportImportStatement(node);
122
- }
123
- else if (node instanceof ExpressionStatement) {
124
- this.visitExpressionStatement(node);
125
- }
126
- else if (node instanceof ForStatement) {
127
- this.visitForStatement(node);
128
- }
129
- else if (node instanceof IfStatement) {
130
- this.visitIfStatement(node);
131
- }
132
- else if (node instanceof ImportStatement) {
133
- this.visitImportStatement(node);
134
- }
135
- else if (node instanceof ReturnStatement) {
136
- this.visitReturnStatement(node);
137
- }
138
- else if (node instanceof SwitchStatement) {
139
- this.visitSwitchStatement(node);
140
- }
141
- else if (node instanceof ThrowStatement) {
142
- this.visitThrowStatement(node);
143
- }
144
- else if (node instanceof TryStatement) {
145
- this.visitTryStatement(node);
146
- }
147
- else if (node instanceof VariableStatement) {
148
- this.visitVariableStatement(node);
149
- }
150
- else if (node instanceof WhileStatement) {
151
- this.visitWhileStatement(node);
152
- }
153
- else if (node instanceof ClassDeclaration) {
154
- this.visitClassDeclaration(node);
155
- }
156
- else if (node instanceof EnumDeclaration) {
157
- this.visitEnumDeclaration(node);
158
- }
159
- else if (node instanceof EnumValueDeclaration) {
160
- this.visitEnumValueDeclaration(node);
161
- }
162
- else if (node instanceof FieldDeclaration) {
163
- this.visitFieldDeclaration(node);
164
- }
165
- else if (node instanceof FunctionDeclaration) {
166
- this.visitFunctionDeclaration(node);
167
- }
168
- else if (node instanceof ImportDeclaration) {
169
- this.visitImportDeclaration(node);
170
- }
171
- else if (node instanceof InterfaceDeclaration) {
172
- this.visitInterfaceDeclaration(node);
173
- }
174
- else if (node instanceof MethodDeclaration) {
175
- this.visitMethodDeclaration(node);
176
- }
177
- else if (node instanceof NamespaceDeclaration) {
178
- this.visitNamespaceDeclaration(node);
179
- }
180
- else if (node instanceof TypeDeclaration) {
181
- this.visitTypeDeclaration(node);
182
- }
183
- else if (node instanceof VariableDeclaration) {
184
- this.visitVariableDeclaration(node);
185
- }
186
- else if (node instanceof DecoratorNode) {
187
- this.visitDecoratorNode(node);
188
- }
189
- else if (node instanceof ExportMember) {
190
- this.visitExportMember(node);
191
- }
192
- else if (node instanceof ParameterNode) {
193
- this.visitParameter(node);
194
- }
195
- else if (node instanceof SwitchCase) {
196
- this.visitSwitchCase(node);
197
- }
198
- else if (node instanceof IndexSignatureNode) {
199
- this.visitIndexSignature(node);
200
- }
201
- else {
202
- throw new Error("Could not visit invalid type!");
203
- }
204
- }
205
- visitSource(node) {
206
- this.currentSource = node;
207
- for (const stmt of node.statements) {
208
- this.depth++;
209
- this._visit(stmt);
210
- this.depth--;
211
- }
212
- this.currentSource = null;
213
- }
214
- visitTypeNode(node) { }
215
- visitTypeName(node) {
216
- this.visit(node.identifier);
217
- this.visit(node.next);
218
- }
219
- visitNamedTypeNode(node) {
220
- this.visit(node.name);
221
- this.visit(node.typeArguments);
222
- }
223
- visitFunctionTypeNode(node) {
224
- this.visit(node.parameters);
225
- this.visit(node.returnType);
226
- this.visit(node.explicitThisType);
227
- }
228
- visitTypeParameter(node) {
229
- this.visit(node.name);
230
- this.visit(node.extendsType);
231
- this.visit(node.defaultType);
232
- }
233
- visitIdentifierExpression(node) { }
234
- visitArrayLiteralExpression(node) {
235
- this.visit(node.elementExpressions);
236
- }
237
- visitObjectLiteralExpression(node) {
238
- this.visit(node.names);
239
- this.visit(node.values);
240
- }
241
- visitAssertionExpression(node) {
242
- this.visit(node.toType);
243
- this.visit(node.expression);
244
- }
245
- visitBinaryExpression(node) {
246
- this.visit(node.left);
247
- this.visit(node.right);
248
- }
249
- visitCallExpression(node) {
250
- this.visit(node.expression);
251
- this.visitArguments(node.typeArguments, node.args);
252
- }
253
- visitArguments(typeArguments, args) {
254
- this.visit(typeArguments);
255
- this.visit(args);
256
- }
257
- visitClassExpression(node) {
258
- this.visit(node.declaration);
259
- }
260
- visitCommaExpression(node) {
261
- this.visit(node.expressions);
262
- }
263
- visitElementAccessExpression(node) {
264
- this.visit(node.elementExpression);
265
- this.visit(node.expression);
266
- }
267
- visitFunctionExpression(node) {
268
- this.visit(node.declaration);
269
- }
270
- visitLiteralExpression(node) {
271
- if (node instanceof FloatLiteralExpression) {
272
- this.visitFloatLiteralExpression(node);
273
- }
274
- else if (node instanceof IntegerLiteralExpression) {
275
- this.visitIntegerLiteralExpression(node);
276
- }
277
- else if (node instanceof StringLiteralExpression) {
278
- this.visitStringLiteralExpression(node);
279
- }
280
- else if (node instanceof TemplateLiteralExpression) {
281
- this.visitTemplateLiteralExpression(node);
282
- }
283
- else if (node instanceof RegexpLiteralExpression) {
284
- this.visitRegexpLiteralExpression(node);
285
- }
286
- else if (node instanceof ArrayLiteralExpression) {
287
- this.visitArrayLiteralExpression(node);
288
- }
289
- else if (node instanceof ObjectLiteralExpression) {
290
- this.visitObjectLiteralExpression(node);
291
- }
292
- else {
293
- throw new Error("Invalid LiteralKind at visitLiteralExpression(): " + node.literalKind);
294
- }
295
- }
296
- visitFloatLiteralExpression(node) { }
297
- visitInstanceOfExpression(node) {
298
- this.visit(node.expression);
299
- this.visit(node.isType);
300
- }
301
- visitIntegerLiteralExpression(node) { }
302
- visitStringLiteral(str, singleQuoted = false) { }
303
- visitStringLiteralExpression(node) {
304
- this.visitStringLiteral(node.value);
305
- }
306
- visitTemplateLiteralExpression(node) { }
307
- visitRegexpLiteralExpression(node) { }
308
- visitNewExpression(node) {
309
- this.visit(node.typeArguments);
310
- this.visitArguments(node.typeArguments, node.args);
311
- this.visit(node.args);
312
- }
313
- visitParenthesizedExpression(node) {
314
- this.visit(node.expression);
315
- }
316
- visitPropertyAccessExpression(node) {
317
- this.visit(node.property);
318
- this.visit(node.expression);
319
- }
320
- visitTernaryExpression(node) {
321
- this.visit(node.condition);
322
- this.visit(node.ifThen);
323
- this.visit(node.ifElse);
324
- }
325
- visitUnaryExpression(node) {
326
- this.visit(node.operand);
327
- }
328
- visitUnaryPostfixExpression(node) {
329
- this.visit(node.operand);
330
- }
331
- visitUnaryPrefixExpression(node) {
332
- this.visit(node.operand);
333
- }
334
- visitSuperExpression(node) { }
335
- visitFalseExpression(node) { }
336
- visitTrueExpression(node) { }
337
- visitThisExpression(node) { }
338
- visitNullExperssion(node) { }
339
- visitConstructorExpression(node) { }
340
- visitNodeAndTerminate(statement) { }
341
- visitBlockStatement(node) {
342
- this.depth++;
343
- this.visit(node.statements);
344
- this.depth--;
345
- }
346
- visitBreakStatement(node) {
347
- this.visit(node.label);
348
- }
349
- visitContinueStatement(node) {
350
- this.visit(node.label);
351
- }
352
- visitClassDeclaration(node, isDefault = false) {
353
- this.visit(node.name);
354
- this.depth++;
355
- this.visit(node.decorators);
356
- if (node.isGeneric ? node.typeParameters != null : node.typeParameters == null) {
357
- this.visit(node.typeParameters);
358
- this.visit(node.extendsType);
359
- this.visit(node.implementsTypes);
360
- this.visit(node.members);
361
- this.depth--;
362
- }
363
- else {
364
- throw new Error("Expected to type parameters to match class declaration, but found type mismatch instead!");
365
- }
366
- }
367
- visitDoStatement(node) {
368
- this.visit(node.condition);
369
- this.visit(node.body);
370
- }
371
- visitEmptyStatement(node) { }
372
- visitEnumDeclaration(node, isDefault = false) {
373
- this.visit(node.name);
374
- this.visit(node.decorators);
375
- this.visit(node.values);
376
- }
377
- visitEnumValueDeclaration(node) {
378
- this.visit(node.name);
379
- this.visit(node.initializer);
380
- }
381
- visitExportImportStatement(node) {
382
- this.visit(node.name);
383
- this.visit(node.externalName);
384
- }
385
- visitExportMember(node) {
386
- this.visit(node.localName);
387
- this.visit(node.exportedName);
388
- }
389
- visitExportStatement(node) {
390
- this.visit(node.path);
391
- this.visit(node.members);
392
- }
393
- visitExportDefaultStatement(node) {
394
- this.visit(node.declaration);
395
- }
396
- visitExpressionStatement(node) {
397
- this.visit(node.expression);
398
- }
399
- visitFieldDeclaration(node) {
400
- this.visit(node.name);
401
- this.visit(node.type);
402
- this.visit(node.initializer);
403
- this.visit(node.decorators);
404
- }
405
- visitForStatement(node) {
406
- this.visit(node.initializer);
407
- this.visit(node.condition);
408
- this.visit(node.incrementor);
409
- this.visit(node.body);
410
- }
411
- visitFunctionDeclaration(node, isDefault = false) {
412
- this.visit(node.name);
413
- this.visit(node.decorators);
414
- this.visit(node.typeParameters);
415
- this.visit(node.signature);
416
- this.depth++;
417
- this.visit(node.body);
418
- this.depth--;
419
- }
420
- visitIfStatement(node) {
421
- this.visit(node.condition);
422
- this.visit(node.ifTrue);
423
- this.visit(node.ifFalse);
424
- }
425
- visitImportDeclaration(node) {
426
- this.visit(node.foreignName);
427
- this.visit(node.name);
428
- this.visit(node.decorators);
429
- }
430
- visitImportStatement(node) {
431
- this.visit(node.namespaceName);
432
- this.visit(node.declarations);
433
- }
434
- visitIndexSignature(node) {
435
- this.visit(node.keyType);
436
- this.visit(node.valueType);
437
- }
438
- visitInterfaceDeclaration(node, isDefault = false) {
439
- this.visit(node.name);
440
- this.visit(node.typeParameters);
441
- this.visit(node.implementsTypes);
442
- this.visit(node.extendsType);
443
- this.depth++;
444
- this.visit(node.members);
445
- this.depth--;
446
- }
447
- visitMethodDeclaration(node) {
448
- this.visit(node.name);
449
- this.visit(node.typeParameters);
450
- this.visit(node.signature);
451
- this.visit(node.decorators);
452
- this.depth++;
453
- this.visit(node.body);
454
- this.depth--;
455
- }
456
- visitNamespaceDeclaration(node, isDefault = false) {
457
- this.visit(node.name);
458
- this.visit(node.decorators);
459
- this.visit(node.members);
460
- }
461
- visitReturnStatement(node) {
462
- this.visit(node.value);
463
- }
464
- visitSwitchCase(node) {
465
- this.visit(node.label);
466
- this.visit(node.statements);
467
- }
468
- visitSwitchStatement(node) {
469
- this.visit(node.condition);
470
- this.depth++;
471
- this.visit(node.cases);
472
- this.depth--;
473
- }
474
- visitThrowStatement(node) {
475
- this.visit(node.value);
476
- }
477
- visitTryStatement(node) {
478
- this.visit(node.bodyStatements);
479
- this.visit(node.catchVariable);
480
- this.visit(node.catchStatements);
481
- this.visit(node.finallyStatements);
482
- }
483
- visitTypeDeclaration(node) {
484
- this.visit(node.name);
485
- this.visit(node.decorators);
486
- this.visit(node.type);
487
- this.visit(node.typeParameters);
488
- }
489
- visitVariableDeclaration(node) {
490
- this.visit(node.name);
491
- this.visit(node.type);
492
- this.visit(node.initializer);
493
- }
494
- visitVariableStatement(node) {
495
- this.visit(node.decorators);
496
- this.visit(node.declarations);
497
- }
498
- visitWhileStatement(node) {
499
- this.visit(node.condition);
500
- this.depth++;
501
- this.visit(node.body);
502
- this.depth--;
503
- }
504
- visitVoidStatement(node) { }
505
- visitComment(node) { }
506
- visitDecoratorNode(node) {
507
- this.visit(node.name);
508
- this.visit(node.args);
509
- }
510
- visitParameter(node) {
511
- this.visit(node.name);
512
- this.visit(node.implicitFieldDeclaration);
513
- this.visit(node.initializer);
514
- this.visit(node.type);
515
- }
516
- }