@ibyar/expressions 0.8.6 → 1.1.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.
Files changed (251) hide show
  1. package/README.md +48 -1
  2. package/api/abstract.d.ts +1 -0
  3. package/api/abstract.d.ts.map +1 -0
  4. package/api/abstract.js +12 -0
  5. package/api/abstract.js.map +1 -1
  6. package/api/class/class.d.ts +1 -0
  7. package/api/class/class.d.ts.map +1 -0
  8. package/api/class/class.js +603 -472
  9. package/api/class/class.js.map +1 -1
  10. package/api/class/decorator.d.ts +1 -0
  11. package/api/class/decorator.d.ts.map +1 -0
  12. package/api/class/decorator.js +53 -41
  13. package/api/class/decorator.js.map +1 -1
  14. package/api/computing/call.d.ts +1 -0
  15. package/api/computing/call.d.ts.map +1 -0
  16. package/api/computing/call.js +83 -69
  17. package/api/computing/call.js.map +1 -1
  18. package/api/computing/debugger.d.ts +1 -0
  19. package/api/computing/debugger.d.ts.map +1 -0
  20. package/api/computing/debugger.js +40 -28
  21. package/api/computing/debugger.js.map +1 -1
  22. package/api/computing/new.d.ts +1 -0
  23. package/api/computing/new.d.ts.map +1 -0
  24. package/api/computing/new.js +81 -68
  25. package/api/computing/new.js.map +1 -1
  26. package/api/computing/rest.d.ts +1 -0
  27. package/api/computing/rest.d.ts.map +1 -0
  28. package/api/computing/rest.js +54 -42
  29. package/api/computing/rest.js.map +1 -1
  30. package/api/computing/return.d.ts +1 -0
  31. package/api/computing/return.d.ts.map +1 -0
  32. package/api/computing/return.js +52 -40
  33. package/api/computing/return.js.map +1 -1
  34. package/api/computing/spread.d.ts +1 -0
  35. package/api/computing/spread.d.ts.map +1 -0
  36. package/api/computing/spread.js +70 -58
  37. package/api/computing/spread.js.map +1 -1
  38. package/api/computing/throw.d.ts +1 -0
  39. package/api/computing/throw.d.ts.map +1 -0
  40. package/api/computing/throw.js +216 -175
  41. package/api/computing/throw.js.map +1 -1
  42. package/api/computing/yield.d.ts +1 -0
  43. package/api/computing/yield.d.ts.map +1 -0
  44. package/api/computing/yield.js +60 -47
  45. package/api/computing/yield.js.map +1 -1
  46. package/api/definition/array.d.ts +1 -0
  47. package/api/definition/array.d.ts.map +1 -0
  48. package/api/definition/array.js +147 -122
  49. package/api/definition/array.js.map +1 -1
  50. package/api/definition/bind.d.ts +1 -0
  51. package/api/definition/bind.d.ts.map +1 -0
  52. package/api/definition/bind.js +85 -70
  53. package/api/definition/bind.js.map +1 -1
  54. package/api/definition/comment.d.ts +1 -0
  55. package/api/definition/comment.d.ts.map +1 -0
  56. package/api/definition/comment.js +44 -32
  57. package/api/definition/comment.js.map +1 -1
  58. package/api/definition/function.d.ts +1 -0
  59. package/api/definition/function.d.ts.map +1 -0
  60. package/api/definition/function.js +500 -443
  61. package/api/definition/function.js.map +1 -1
  62. package/api/definition/member.d.ts +1 -0
  63. package/api/definition/member.d.ts.map +1 -0
  64. package/api/definition/member.js +104 -89
  65. package/api/definition/member.js.map +1 -1
  66. package/api/definition/object.d.ts +1 -0
  67. package/api/definition/object.d.ts.map +1 -0
  68. package/api/definition/object.js +243 -200
  69. package/api/definition/object.js.map +1 -1
  70. package/api/definition/statement.d.ts +1 -0
  71. package/api/definition/statement.d.ts.map +1 -0
  72. package/api/definition/statement.js +56 -44
  73. package/api/definition/statement.js.map +1 -1
  74. package/api/definition/values.d.ts +1 -0
  75. package/api/definition/values.d.ts.map +1 -0
  76. package/api/definition/values.js +228 -160
  77. package/api/definition/values.js.map +1 -1
  78. package/api/deserialize/deserialize.d.ts +2 -1
  79. package/api/deserialize/deserialize.d.ts.map +1 -0
  80. package/api/deserialize/deserialize.js +5 -7
  81. package/api/deserialize/deserialize.js.map +1 -1
  82. package/api/deserialize/type-store.d.ts +1 -0
  83. package/api/deserialize/type-store.d.ts.map +1 -0
  84. package/api/expression.d.ts +1 -0
  85. package/api/expression.d.ts.map +1 -0
  86. package/api/index.d.ts +1 -0
  87. package/api/index.d.ts.map +1 -0
  88. package/api/module/common.d.ts +1 -0
  89. package/api/module/common.d.ts.map +1 -0
  90. package/api/module/common.js +63 -50
  91. package/api/module/common.js.map +1 -1
  92. package/api/module/export.d.ts +1 -0
  93. package/api/module/export.d.ts.map +1 -0
  94. package/api/module/export.js +343 -290
  95. package/api/module/export.js.map +1 -1
  96. package/api/module/import.d.ts +1 -0
  97. package/api/module/import.d.ts.map +1 -0
  98. package/api/module/import.js +318 -253
  99. package/api/module/import.js.map +1 -1
  100. package/api/operators/assignment.d.ts +1 -0
  101. package/api/operators/assignment.d.ts.map +1 -0
  102. package/api/operators/assignment.js +88 -75
  103. package/api/operators/assignment.js.map +1 -1
  104. package/api/operators/await.d.ts +1 -0
  105. package/api/operators/await.d.ts.map +1 -0
  106. package/api/operators/await.js +54 -42
  107. package/api/operators/await.js.map +1 -1
  108. package/api/operators/binary.d.ts +1 -0
  109. package/api/operators/binary.d.ts.map +1 -0
  110. package/api/operators/binary.js +78 -64
  111. package/api/operators/binary.js.map +1 -1
  112. package/api/operators/chaining.d.ts +1 -0
  113. package/api/operators/chaining.d.ts.map +1 -0
  114. package/api/operators/chaining.js +56 -44
  115. package/api/operators/chaining.js.map +1 -1
  116. package/api/operators/comma.d.ts +1 -0
  117. package/api/operators/comma.d.ts.map +1 -0
  118. package/api/operators/comma.js +53 -41
  119. package/api/operators/comma.js.map +1 -1
  120. package/api/operators/grouping.d.ts +1 -0
  121. package/api/operators/grouping.d.ts.map +1 -0
  122. package/api/operators/grouping.js +51 -39
  123. package/api/operators/grouping.js.map +1 -1
  124. package/api/operators/logical.d.ts +1 -0
  125. package/api/operators/logical.d.ts.map +1 -0
  126. package/api/operators/logical.js +51 -37
  127. package/api/operators/logical.js.map +1 -1
  128. package/api/operators/pipeline.d.ts +1 -0
  129. package/api/operators/pipeline.d.ts.map +1 -0
  130. package/api/operators/pipeline.js +95 -81
  131. package/api/operators/pipeline.js.map +1 -1
  132. package/api/operators/ternary.d.ts +1 -0
  133. package/api/operators/ternary.d.ts.map +1 -0
  134. package/api/operators/ternary.js +69 -55
  135. package/api/operators/ternary.js.map +1 -1
  136. package/api/operators/types.d.ts +1 -0
  137. package/api/operators/types.d.ts.map +1 -0
  138. package/api/operators/unary.d.ts +1 -0
  139. package/api/operators/unary.d.ts.map +1 -0
  140. package/api/operators/unary.js +97 -82
  141. package/api/operators/unary.js.map +1 -1
  142. package/api/operators/update.d.ts +1 -0
  143. package/api/operators/update.d.ts.map +1 -0
  144. package/api/operators/update.js +78 -62
  145. package/api/operators/update.js.map +1 -1
  146. package/api/program.d.ts +1 -0
  147. package/api/program.d.ts.map +1 -0
  148. package/api/program.js +53 -40
  149. package/api/program.js.map +1 -1
  150. package/api/statement/control/block.d.ts +1 -0
  151. package/api/statement/control/block.d.ts.map +1 -0
  152. package/api/statement/control/block.js +65 -53
  153. package/api/statement/control/block.js.map +1 -1
  154. package/api/statement/control/empty.d.ts +1 -1
  155. package/api/statement/control/empty.d.ts.map +1 -0
  156. package/api/statement/control/empty.js +43 -33
  157. package/api/statement/control/empty.js.map +1 -1
  158. package/api/statement/control/if.d.ts +1 -0
  159. package/api/statement/control/if.d.ts.map +1 -0
  160. package/api/statement/control/if.js +79 -65
  161. package/api/statement/control/if.js.map +1 -1
  162. package/api/statement/control/switch.d.ts +1 -0
  163. package/api/statement/control/switch.d.ts.map +1 -0
  164. package/api/statement/control/switch.js +180 -141
  165. package/api/statement/control/switch.js.map +1 -1
  166. package/api/statement/control/terminate.d.ts +1 -2
  167. package/api/statement/control/terminate.d.ts.map +1 -0
  168. package/api/statement/control/terminate.js +117 -78
  169. package/api/statement/control/terminate.js.map +1 -1
  170. package/api/statement/control/with.d.ts +1 -0
  171. package/api/statement/control/with.d.ts.map +1 -0
  172. package/api/statement/control/with.js +72 -59
  173. package/api/statement/control/with.js.map +1 -1
  174. package/api/statement/declarations/declares.d.ts +1 -0
  175. package/api/statement/declarations/declares.d.ts.map +1 -0
  176. package/api/statement/declarations/declares.js +148 -121
  177. package/api/statement/declarations/declares.js.map +1 -1
  178. package/api/statement/iterations/for.d.ts +1 -0
  179. package/api/statement/iterations/for.d.ts.map +1 -0
  180. package/api/statement/iterations/for.js +337 -277
  181. package/api/statement/iterations/for.js.map +1 -1
  182. package/api/statement/iterations/while.d.ts +1 -0
  183. package/api/statement/iterations/while.d.ts.map +1 -0
  184. package/api/statement/iterations/while.js +152 -125
  185. package/api/statement/iterations/while.js.map +1 -1
  186. package/api/utils.d.ts +1 -0
  187. package/api/utils.d.ts.map +1 -0
  188. package/index.d.ts +1 -0
  189. package/index.d.ts.map +1 -0
  190. package/package.json +5 -5
  191. package/scope/builder.d.ts +27 -0
  192. package/scope/builder.d.ts.map +1 -0
  193. package/scope/builder.js +73 -0
  194. package/scope/builder.js.map +1 -0
  195. package/scope/event.d.ts +1 -0
  196. package/scope/event.d.ts.map +1 -0
  197. package/scope/finalizer.d.ts +1 -0
  198. package/scope/finalizer.d.ts.map +1 -0
  199. package/scope/index.d.ts +1 -0
  200. package/scope/index.d.ts.map +1 -0
  201. package/scope/pool.d.ts +1 -0
  202. package/scope/pool.d.ts.map +1 -0
  203. package/scope/proxy.d.ts +1 -0
  204. package/scope/proxy.d.ts.map +1 -0
  205. package/scope/proxy.js +1 -0
  206. package/scope/proxy.js.map +1 -1
  207. package/scope/scope.d.ts +1 -0
  208. package/scope/scope.d.ts.map +1 -0
  209. package/scope/scope.js +17 -11
  210. package/scope/scope.js.map +1 -1
  211. package/scope/stack.d.ts +1 -0
  212. package/scope/stack.d.ts.map +1 -0
  213. package/scope/stack.js +22 -14
  214. package/scope/stack.js.map +1 -1
  215. package/v8/enums.d.ts +1 -0
  216. package/v8/enums.d.ts.map +1 -0
  217. package/v8/enums.js +11 -11
  218. package/v8/enums.js.map +1 -1
  219. package/v8/factory.d.ts +1 -0
  220. package/v8/factory.d.ts.map +1 -0
  221. package/v8/factory.js +3 -1
  222. package/v8/factory.js.map +1 -1
  223. package/v8/index.d.ts +1 -0
  224. package/v8/index.d.ts.map +1 -0
  225. package/v8/inline.d.ts +1 -0
  226. package/v8/inline.d.ts.map +1 -0
  227. package/v8/inline.js +9 -5
  228. package/v8/inline.js.map +1 -1
  229. package/v8/language.d.ts +1 -0
  230. package/v8/language.d.ts.map +1 -0
  231. package/v8/node.d.ts +1 -0
  232. package/v8/node.d.ts.map +1 -0
  233. package/v8/parser.d.ts +1 -0
  234. package/v8/parser.d.ts.map +1 -0
  235. package/v8/parser.js +5 -5
  236. package/v8/parser.js.map +1 -1
  237. package/v8/stream.d.ts +1 -0
  238. package/v8/stream.d.ts.map +1 -0
  239. package/v8/stream.js +17 -7
  240. package/v8/stream.js.map +1 -1
  241. package/v8/token.d.ts +1 -0
  242. package/v8/token.d.ts.map +1 -0
  243. package/v8/token.js +363 -358
  244. package/v8/token.js.map +1 -1
  245. package/visit/index.d.ts +1 -0
  246. package/visit/index.d.ts.map +1 -0
  247. package/visit/visitor.d.ts +1 -0
  248. package/visit/visitor.d.ts.map +1 -0
  249. package/v8/nodes.d.ts +0 -0
  250. package/v8/nodes.js +0 -2
  251. package/v8/nodes.js.map +0 -1
@@ -1,491 +1,548 @@
1
- var AssignmentPattern_1, FunctionExpression_1, FunctionDeclaration_1, ArrowFunctionExpression_1;
2
- import { __decorate, __metadata } from "tslib";
1
+ import { __esDecorate, __runInitializers } from "tslib";
3
2
  import { AbstractExpressionNode, AwaitPromise, ReturnValue, YieldDelegateValue, YieldValue } from '../abstract.js';
4
3
  import { Deserializer } from '../deserialize/deserialize.js';
5
- import { Identifier } from './values.js';
6
4
  import { TerminateReturnType } from '../statement/control/terminate.js';
7
5
  import { RestElement } from '../computing/rest.js';
8
- let AssignmentPattern = AssignmentPattern_1 = class AssignmentPattern extends AbstractExpressionNode {
9
- static fromJSON(node, deserializer) {
10
- return new AssignmentPattern_1(deserializer(node.left), deserializer(node.right), node.range, node.loc);
11
- }
12
- static visit(node, visitNode) {
13
- visitNode(node.left);
14
- visitNode(node.right);
15
- }
16
- constructor(left, right, range, loc) {
17
- super(range, loc);
18
- this.left = left;
19
- this.right = right;
20
- }
21
- getLeft() {
22
- return this.left;
23
- }
24
- getRight() {
25
- return this.right;
26
- }
27
- set(stack, value) {
28
- throw new Error('AssignmentPattern#set() has no implementation.');
29
- }
30
- get(stack) {
31
- throw new Error('AssignmentPattern#get() has no implementation.');
32
- }
33
- declareVariable(stack, value) {
34
- if (value === undefined) {
35
- value = this.right.get(stack);
36
- }
37
- this.left.declareVariable(stack, value);
38
- }
39
- dependency(computed) {
40
- return [this.right];
41
- }
42
- dependencyPath(computed) {
43
- return this.right.dependencyPath(computed) || [];
44
- }
45
- toString() {
46
- return `${this.left.toString()} = ${this.right.toString()}`;
47
- }
48
- toJson() {
49
- return {
50
- left: this.left.toJSON(),
51
- right: this.right.toJSON()
52
- };
53
- }
54
- };
55
- AssignmentPattern = AssignmentPattern_1 = __decorate([
56
- Deserializer('AssignmentPattern'),
57
- __metadata("design:paramtypes", [Object, Object, Array, Object])
58
- ], AssignmentPattern);
6
+ let AssignmentPattern = (() => {
7
+ let _classDecorators = [Deserializer('AssignmentPattern')];
8
+ let _classDescriptor;
9
+ let _classExtraInitializers = [];
10
+ let _classThis;
11
+ let _classSuper = AbstractExpressionNode;
12
+ var AssignmentPattern = class extends _classSuper {
13
+ static { _classThis = this; }
14
+ static {
15
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
16
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
17
+ AssignmentPattern = _classThis = _classDescriptor.value;
18
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
19
+ __runInitializers(_classThis, _classExtraInitializers);
20
+ }
21
+ left;
22
+ right;
23
+ static fromJSON(node, deserializer) {
24
+ return new AssignmentPattern(deserializer(node.left), deserializer(node.right), node.range, node.loc);
25
+ }
26
+ static visit(node, visitNode) {
27
+ visitNode(node.left);
28
+ visitNode(node.right);
29
+ }
30
+ constructor(left, right, range, loc) {
31
+ super(range, loc);
32
+ this.left = left;
33
+ this.right = right;
34
+ }
35
+ getLeft() {
36
+ return this.left;
37
+ }
38
+ getRight() {
39
+ return this.right;
40
+ }
41
+ set(stack, value) {
42
+ throw new Error('AssignmentPattern#set() has no implementation.');
43
+ }
44
+ get(stack) {
45
+ throw new Error('AssignmentPattern#get() has no implementation.');
46
+ }
47
+ declareVariable(stack, value) {
48
+ if (value === undefined) {
49
+ value = this.right.get(stack);
50
+ }
51
+ this.left.declareVariable(stack, value);
52
+ }
53
+ dependency(computed) {
54
+ return [this.right];
55
+ }
56
+ dependencyPath(computed) {
57
+ return this.right.dependencyPath(computed) || [];
58
+ }
59
+ toString() {
60
+ return `${this.left.toString()} = ${this.right.toString()}`;
61
+ }
62
+ toJson() {
63
+ return {
64
+ left: this.left.toJSON(),
65
+ right: this.right.toJSON()
66
+ };
67
+ }
68
+ };
69
+ return AssignmentPattern = _classThis;
70
+ })();
59
71
  export { AssignmentPattern };
60
- let FunctionExpression = FunctionExpression_1 = class FunctionExpression extends AbstractExpressionNode {
61
- static fromJSON(node, deserializer) {
62
- return new FunctionExpression_1(node.params.map(deserializer), deserializer(node.body), node.async, node.generator, node.id ? deserializer(node.id) : void 0, node.range, node.loc);
63
- }
64
- static visit(node, visitNode) {
65
- node.id && visitNode(node.id);
66
- node.params.forEach(visitNode);
67
- visitNode(node.body);
68
- }
69
- constructor(params, body, async, generator, id, range, loc) {
70
- super(range, loc);
71
- this.params = params;
72
- this.body = body;
73
- this.async = async;
74
- this.generator = generator;
75
- this.id = id;
76
- }
77
- getParams() {
78
- return this.params;
79
- }
80
- getBody() {
81
- return this.body;
82
- }
83
- getGenerator() {
84
- return this.generator;
85
- }
86
- getId() {
87
- return this.id;
88
- }
89
- getAsync() {
90
- return this.async;
91
- }
92
- set(stack, value) {
93
- throw new Error(`${this.constructor.name}#set() has no implementation.`);
94
- }
95
- defineFunctionArguments(stack, args) {
96
- const rest = this.params[this.params.length - 1] instanceof RestElement;
97
- const limit = rest ? this.params.length - 1 : this.params.length;
98
- for (let i = 0; i < limit; i++) {
99
- this.params[i].declareVariable(stack, args[i]);
100
- }
101
- if (rest) {
102
- this.params[limit].declareVariable(stack, args.slice(limit));
103
- }
104
- }
105
- get(stack) {
106
- // freeze scopes
107
- stack = stack.copyStack();
108
- let func;
109
- if (this.async && this.generator) {
110
- func = this.getAsyncGeneratorFunction(stack);
111
- }
112
- else if (this.async) {
113
- func = this.getAsyncFunction(stack);
114
- }
115
- else if (this.generator) {
116
- func = this.getGeneratorFunction(stack);
117
- }
118
- else {
119
- func = this.getFunction(stack);
120
- }
121
- // this.id?.declareVariable(stack, func);
122
- return func;
123
- }
124
- getAsyncFunction(gStack) {
125
- const self = this;
126
- return async function (...args) {
127
- const stack = gStack.copyStack();
128
- stack.pushBlockScope();
129
- stack.declareVariable('this', this);
130
- stack.declareVariable('super', this?.constructor?.prototype);
131
- self.defineFunctionArguments(stack, args);
132
- let returnValue;
133
- const statements = self.body.getBody();
134
- for (const statement of statements) {
135
- returnValue = statement.get(stack);
136
- if (stack.awaitPromise?.length > 0) {
137
- for (const awaitRef of stack.awaitPromise) {
138
- const awaitValue = await awaitRef.promise;
139
- if (awaitRef.declareVariable) {
140
- awaitRef.node.declareVariable(stack, awaitValue);
141
- }
142
- else {
143
- awaitRef.node.set(stack, awaitValue);
72
+ let FunctionExpression = (() => {
73
+ let _classDecorators = [Deserializer('FunctionExpression')];
74
+ let _classDescriptor;
75
+ let _classExtraInitializers = [];
76
+ let _classThis;
77
+ let _classSuper = AbstractExpressionNode;
78
+ var FunctionExpression = class extends _classSuper {
79
+ static { _classThis = this; }
80
+ static {
81
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
82
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
83
+ FunctionExpression = _classThis = _classDescriptor.value;
84
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
85
+ __runInitializers(_classThis, _classExtraInitializers);
86
+ }
87
+ params;
88
+ body;
89
+ async;
90
+ generator;
91
+ id;
92
+ static fromJSON(node, deserializer) {
93
+ return new FunctionExpression(node.params.map(deserializer), deserializer(node.body), node.async, node.generator, node.id ? deserializer(node.id) : void 0, node.range, node.loc);
94
+ }
95
+ static visit(node, visitNode) {
96
+ node.id && visitNode(node.id);
97
+ node.params.forEach(visitNode);
98
+ visitNode(node.body);
99
+ }
100
+ constructor(params, body, async, generator, id, range, loc) {
101
+ super(range, loc);
102
+ this.params = params;
103
+ this.body = body;
104
+ this.async = async;
105
+ this.generator = generator;
106
+ this.id = id;
107
+ }
108
+ getParams() {
109
+ return this.params;
110
+ }
111
+ getBody() {
112
+ return this.body;
113
+ }
114
+ getGenerator() {
115
+ return this.generator;
116
+ }
117
+ getId() {
118
+ return this.id;
119
+ }
120
+ getAsync() {
121
+ return this.async;
122
+ }
123
+ set(stack, value) {
124
+ throw new Error(`${this.constructor.name}#set() has no implementation.`);
125
+ }
126
+ defineFunctionArguments(stack, args) {
127
+ const rest = this.params[this.params.length - 1] instanceof RestElement;
128
+ const limit = rest ? this.params.length - 1 : this.params.length;
129
+ for (let i = 0; i < limit; i++) {
130
+ this.params[i].declareVariable(stack, args[i]);
131
+ }
132
+ if (rest) {
133
+ this.params[limit].declareVariable(stack, args.slice(limit));
134
+ }
135
+ }
136
+ get(stack) {
137
+ // freeze scopes
138
+ stack = stack.copyStack();
139
+ let func;
140
+ if (this.async && this.generator) {
141
+ func = this.getAsyncGeneratorFunction(stack);
142
+ }
143
+ else if (this.async) {
144
+ func = this.getAsyncFunction(stack);
145
+ }
146
+ else if (this.generator) {
147
+ func = this.getGeneratorFunction(stack);
148
+ }
149
+ else {
150
+ func = this.getFunction(stack);
151
+ }
152
+ // this.id?.declareVariable(stack, func);
153
+ return func;
154
+ }
155
+ getAsyncFunction(gStack) {
156
+ const self = this;
157
+ return async function (...args) {
158
+ const stack = gStack.copyStack();
159
+ stack.pushBlockScope();
160
+ stack.declareVariable('this', this);
161
+ stack.declareVariable('super', this?.constructor?.prototype);
162
+ self.defineFunctionArguments(stack, args);
163
+ let returnValue;
164
+ const statements = self.body.getBody();
165
+ for (const statement of statements) {
166
+ returnValue = statement.get(stack);
167
+ if (stack.awaitPromise?.length > 0) {
168
+ for (const awaitRef of stack.awaitPromise) {
169
+ const awaitValue = await awaitRef.promise;
170
+ if (awaitRef.declareVariable) {
171
+ awaitRef.node.declareVariable(stack, awaitValue);
172
+ }
173
+ else {
174
+ awaitRef.node.set(stack, awaitValue);
175
+ }
144
176
  }
177
+ stack.awaitPromise.splice(0);
145
178
  }
146
- stack.awaitPromise.splice(0);
147
- }
148
- else if (stack.forAwaitAsyncIterable) {
149
- for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
150
- const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
151
- if (result instanceof TerminateReturnType) {
152
- if (result.type === 'continue') {
153
- continue;
179
+ else if (stack.forAwaitAsyncIterable) {
180
+ for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
181
+ const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
182
+ if (result instanceof TerminateReturnType) {
183
+ if (result.type === 'continue') {
184
+ continue;
185
+ }
186
+ else {
187
+ break;
188
+ }
154
189
  }
155
- else {
190
+ else if (result instanceof ReturnValue) {
191
+ returnValue = result;
156
192
  break;
157
193
  }
158
194
  }
159
- else if (result instanceof ReturnValue) {
160
- returnValue = result;
161
- break;
195
+ stack.forAwaitAsyncIterable = undefined;
196
+ }
197
+ if (returnValue instanceof ReturnValue) {
198
+ returnValue = returnValue.value;
199
+ if (returnValue instanceof AwaitPromise) {
200
+ returnValue = await returnValue.promise;
162
201
  }
202
+ return returnValue;
163
203
  }
164
- stack.forAwaitAsyncIterable = undefined;
165
204
  }
166
- if (returnValue instanceof ReturnValue) {
167
- returnValue = returnValue.value;
168
- if (returnValue instanceof AwaitPromise) {
169
- returnValue = await returnValue.promise;
205
+ };
206
+ }
207
+ getGeneratorFunction(gStack) {
208
+ const self = this;
209
+ return function* (...args) {
210
+ const stack = gStack.copyStack();
211
+ stack.pushBlockScope();
212
+ stack.declareVariable('this', this);
213
+ stack.declareVariable('super', this?.constructor?.prototype);
214
+ self.defineFunctionArguments(stack, args);
215
+ let returnValue;
216
+ const statements = self.body.getBody();
217
+ for (const statement of statements) {
218
+ returnValue = statement.get(stack);
219
+ if (returnValue instanceof ReturnValue) {
220
+ return returnValue.value;
170
221
  }
171
- return returnValue;
172
- }
173
- }
174
- };
175
- }
176
- getGeneratorFunction(gStack) {
177
- const self = this;
178
- return function* (...args) {
179
- const stack = gStack.copyStack();
180
- stack.pushBlockScope();
181
- stack.declareVariable('this', this);
182
- stack.declareVariable('super', this?.constructor?.prototype);
183
- self.defineFunctionArguments(stack, args);
184
- let returnValue;
185
- const statements = self.body.getBody();
186
- for (const statement of statements) {
187
- returnValue = statement.get(stack);
188
- if (returnValue instanceof ReturnValue) {
189
- return returnValue.value;
190
- }
191
- else if (returnValue instanceof YieldValue) {
192
- yield returnValue.value;
193
- }
194
- else if (returnValue instanceof YieldDelegateValue) {
195
- yield* returnValue.value;
196
- }
197
- }
198
- };
199
- }
200
- getAsyncGeneratorFunction(gStack) {
201
- const self = this;
202
- return async function* (...args) {
203
- const stack = gStack.copyStack();
204
- stack.pushBlockScope();
205
- stack.declareVariable('this', this);
206
- stack.declareVariable('super', this?.constructor?.prototype);
207
- self.defineFunctionArguments(stack, args);
208
- let returnValue;
209
- const statements = self.body.getBody();
210
- for (const statement of statements) {
211
- returnValue = statement.get(stack);
212
- if (stack.awaitPromise?.length > 0) {
213
- for (const awaitRef of stack.awaitPromise) {
214
- const awaitValue = await awaitRef.promise;
215
- if (awaitRef.declareVariable) {
216
- awaitRef.node.declareVariable(stack, awaitValue);
217
- }
218
- else {
219
- awaitRef.node.set(stack, awaitValue);
220
- }
222
+ else if (returnValue instanceof YieldValue) {
223
+ yield returnValue.value;
224
+ }
225
+ else if (returnValue instanceof YieldDelegateValue) {
226
+ yield* returnValue.value;
221
227
  }
222
- stack.awaitPromise.splice(0);
223
228
  }
224
- else if (stack.forAwaitAsyncIterable) {
225
- for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
226
- const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
227
- if (result instanceof TerminateReturnType) {
228
- if (result.type === 'continue') {
229
- continue;
229
+ };
230
+ }
231
+ getAsyncGeneratorFunction(gStack) {
232
+ const self = this;
233
+ return async function* (...args) {
234
+ const stack = gStack.copyStack();
235
+ stack.pushBlockScope();
236
+ stack.declareVariable('this', this);
237
+ stack.declareVariable('super', this?.constructor?.prototype);
238
+ self.defineFunctionArguments(stack, args);
239
+ let returnValue;
240
+ const statements = self.body.getBody();
241
+ for (const statement of statements) {
242
+ returnValue = statement.get(stack);
243
+ if (stack.awaitPromise?.length > 0) {
244
+ for (const awaitRef of stack.awaitPromise) {
245
+ const awaitValue = await awaitRef.promise;
246
+ if (awaitRef.declareVariable) {
247
+ awaitRef.node.declareVariable(stack, awaitValue);
230
248
  }
231
249
  else {
232
- break;
250
+ awaitRef.node.set(stack, awaitValue);
233
251
  }
234
252
  }
235
- else if (result instanceof ReturnValue) {
236
- returnValue = returnValue.value;
237
- if (returnValue instanceof AwaitPromise) {
238
- return await returnValue.promise;
239
- }
240
- else if (returnValue instanceof YieldValue) {
241
- yield returnValue.value;
253
+ stack.awaitPromise.splice(0);
254
+ }
255
+ else if (stack.forAwaitAsyncIterable) {
256
+ for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
257
+ const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
258
+ if (result instanceof TerminateReturnType) {
259
+ if (result.type === 'continue') {
260
+ continue;
261
+ }
262
+ else {
263
+ break;
264
+ }
242
265
  }
243
- else if (returnValue instanceof YieldDelegateValue) {
244
- yield* returnValue.value;
266
+ else if (result instanceof ReturnValue) {
267
+ returnValue = returnValue.value;
268
+ if (returnValue instanceof AwaitPromise) {
269
+ return await returnValue.promise;
270
+ }
271
+ else if (returnValue instanceof YieldValue) {
272
+ yield returnValue.value;
273
+ }
274
+ else if (returnValue instanceof YieldDelegateValue) {
275
+ yield* returnValue.value;
276
+ }
277
+ return returnValue;
245
278
  }
246
- return returnValue;
247
279
  }
280
+ stack.forAwaitAsyncIterable = undefined;
281
+ }
282
+ if (returnValue instanceof ReturnValue) {
283
+ returnValue = returnValue.value;
284
+ if (returnValue instanceof AwaitPromise) {
285
+ return await returnValue.promise;
286
+ }
287
+ return returnValue;
248
288
  }
249
- stack.forAwaitAsyncIterable = undefined;
250
289
  }
251
- if (returnValue instanceof ReturnValue) {
252
- returnValue = returnValue.value;
253
- if (returnValue instanceof AwaitPromise) {
254
- return await returnValue.promise;
290
+ };
291
+ }
292
+ getFunction(gStack) {
293
+ const self = this;
294
+ return function (...args) {
295
+ const stack = gStack.copyStack();
296
+ stack.pushBlockScope();
297
+ stack.declareVariable('this', this);
298
+ stack.declareVariable('super', this?.constructor?.prototype);
299
+ self.defineFunctionArguments(stack, args);
300
+ let returnValue;
301
+ const statements = self.body.getBody();
302
+ for (const statement of statements) {
303
+ returnValue = statement.get(stack);
304
+ if (returnValue instanceof ReturnValue) {
305
+ return returnValue.value;
255
306
  }
256
- return returnValue;
257
307
  }
308
+ };
309
+ }
310
+ dependency(computed) {
311
+ return this.params.flatMap(param => param.dependency());
312
+ }
313
+ dependencyPath(computed) {
314
+ return this.params.flatMap(param => param.dependencyPath(computed));
315
+ }
316
+ toString() {
317
+ let declare = 'function ';
318
+ if (this.async && this.generator) {
319
+ declare = 'async function* ';
258
320
  }
259
- };
260
- }
261
- getFunction(gStack) {
262
- const self = this;
263
- return function (...args) {
264
- const stack = gStack.copyStack();
265
- stack.pushBlockScope();
266
- stack.declareVariable('this', this);
267
- stack.declareVariable('super', this?.constructor?.prototype);
268
- self.defineFunctionArguments(stack, args);
269
- let returnValue;
270
- const statements = self.body.getBody();
271
- for (const statement of statements) {
272
- returnValue = statement.get(stack);
273
- if (returnValue instanceof ReturnValue) {
274
- return returnValue.value;
275
- }
321
+ else if (this.async) {
322
+ declare = 'async function ';
323
+ }
324
+ else if (this.generator) {
325
+ declare = 'function* ';
276
326
  }
277
- };
278
- }
279
- dependency(computed) {
280
- return this.params.flatMap(param => param.dependency());
281
- }
282
- dependencyPath(computed) {
283
- return this.params.flatMap(param => param.dependencyPath(computed));
284
- }
285
- toString() {
286
- let declare = 'function ';
287
- if (this.async && this.generator) {
288
- declare = 'async function* ';
289
- }
290
- else if (this.async) {
291
- declare = 'async function ';
292
- }
293
- else if (this.generator) {
294
- declare = 'function* ';
295
- }
296
- return `${declare}${this.id?.toString() || ''}${this.paramsAndBodyToString()}`;
297
- }
298
- paramsAndBodyToString() {
299
- return `(${this.params.map(param => param.toString()).join(', ')}) ${this.body.toString()}`;
300
- }
301
- toJson() {
302
- return {
303
- params: this.params.map(param => param.toJSON()),
304
- body: this.body.toJSON(),
305
- async: this.async,
306
- id: this.id?.toJSON(),
307
- generator: this.generator
308
- };
309
- }
310
- };
311
- FunctionExpression = FunctionExpression_1 = __decorate([
312
- Deserializer('FunctionExpression'),
313
- __metadata("design:paramtypes", [Array, Object, Boolean, Boolean, Identifier, Array, Object])
314
- ], FunctionExpression);
327
+ return `${declare}${this.id?.toString() || ''}${this.paramsAndBodyToString()}`;
328
+ }
329
+ paramsAndBodyToString() {
330
+ return `(${this.params.map(param => param.toString()).join(', ')}) ${this.body.toString()}`;
331
+ }
332
+ toJson() {
333
+ return {
334
+ params: this.params.map(param => param.toJSON()),
335
+ body: this.body.toJSON(),
336
+ async: this.async,
337
+ id: this.id?.toJSON(),
338
+ generator: this.generator
339
+ };
340
+ }
341
+ };
342
+ return FunctionExpression = _classThis;
343
+ })();
315
344
  export { FunctionExpression };
316
- let FunctionDeclaration = FunctionDeclaration_1 = class FunctionDeclaration extends FunctionExpression {
317
- static fromJSON(node, deserializer) {
318
- return new FunctionDeclaration_1(node.params.map(deserializer), deserializer(node.body), node.async, node.generator, deserializer(node.id), node.range, node.loc);
319
- }
320
- static visit(node, visitNode) {
321
- visitNode(node.id);
322
- node.params.forEach(visitNode);
323
- visitNode(node.body);
324
- }
325
- constructor(params, body, async, generator, id, range, loc) {
326
- super(params, body, async, generator, id, range, loc);
327
- }
328
- get(stack) {
329
- const func = super.get(stack);
330
- this.declareVariable(stack, func);
331
- return func;
332
- }
333
- declareVariable(stack, value) {
334
- this.id.declareVariable(stack, value);
335
- }
336
- };
337
- FunctionDeclaration = FunctionDeclaration_1 = __decorate([
338
- Deserializer('FunctionDeclaration'),
339
- __metadata("design:paramtypes", [Array, Object, Boolean, Boolean, Identifier, Array, Object])
340
- ], FunctionDeclaration);
345
+ let FunctionDeclaration = (() => {
346
+ let _classDecorators = [Deserializer('FunctionDeclaration')];
347
+ let _classDescriptor;
348
+ let _classExtraInitializers = [];
349
+ let _classThis;
350
+ let _classSuper = FunctionExpression;
351
+ var FunctionDeclaration = class extends _classSuper {
352
+ static { _classThis = this; }
353
+ static {
354
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
355
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
356
+ FunctionDeclaration = _classThis = _classDescriptor.value;
357
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
358
+ __runInitializers(_classThis, _classExtraInitializers);
359
+ }
360
+ static fromJSON(node, deserializer) {
361
+ return new FunctionDeclaration(node.params.map(deserializer), deserializer(node.body), node.async, node.generator, deserializer(node.id), node.range, node.loc);
362
+ }
363
+ static visit(node, visitNode) {
364
+ visitNode(node.id);
365
+ node.params.forEach(visitNode);
366
+ visitNode(node.body);
367
+ }
368
+ constructor(params, body, async, generator, id, range, loc) {
369
+ super(params, body, async, generator, id, range, loc);
370
+ }
371
+ get(stack) {
372
+ const func = super.get(stack);
373
+ this.declareVariable(stack, func);
374
+ return func;
375
+ }
376
+ declareVariable(stack, value) {
377
+ this.id.declareVariable(stack, value);
378
+ }
379
+ };
380
+ return FunctionDeclaration = _classThis;
381
+ })();
341
382
  export { FunctionDeclaration };
342
- let ArrowFunctionExpression = ArrowFunctionExpression_1 = class ArrowFunctionExpression extends AbstractExpressionNode {
343
- static fromJSON(node, deserializer) {
344
- return new ArrowFunctionExpression_1(node.params.map(deserializer), Array.isArray(node.body)
345
- ? node.body.map(deserializer)
346
- : deserializer(node.body), node.expression, node.async, node.range, node.loc);
347
- }
348
- static visit(node, visitNode) {
349
- node.params.forEach(visitNode);
350
- Array.isArray(node.body)
351
- ? node.body.forEach(visitNode)
352
- : visitNode(node.body);
353
- }
354
- constructor(params, body, expression, async, range, loc) {
355
- super(range, loc);
356
- this.params = params;
357
- this.body = body;
358
- this.expression = expression;
359
- this.async = async;
360
- this.generator = false;
361
- }
362
- getParams() {
363
- return this.params;
364
- }
365
- getBody() {
366
- return this.body;
367
- }
368
- getExpression() {
369
- return this.expression;
370
- }
371
- set(stack, value) {
372
- throw new Error('ArrowFunctionExpression#set() has no implementation.');
373
- }
374
- setParameter(stack, args) {
375
- const rest = this.params[this.params.length - 1] instanceof RestElement;
376
- const limit = rest ? this.params.length - 1 : this.params.length;
377
- for (let i = 0; i < limit; i++) {
378
- this.params[i].declareVariable(stack, args[i]);
379
- }
380
- if (rest) {
381
- this.params[limit].declareVariable(stack, args.slice(limit));
382
- }
383
- }
384
- get(stack) {
385
- // freeze stack
386
- stack = stack.copyStack();
387
- return this.async ? this.getAsyncArrowFunction(stack) : this.getArrowFunction(stack);
388
- }
389
- getAsyncArrowFunction(gStack) {
390
- async (...args) => {
391
- const stack = gStack.copyStack();
392
- stack.pushBlockScope();
393
- this.setParameter(stack, args);
394
- let returnValue;
395
- const statements = Array.isArray(this.body) ? this.body : [this.body];
396
- for (const state of statements) {
397
- returnValue = state.get(stack);
398
- if (stack.awaitPromise?.length > 0) {
399
- for (const awaitRef of stack.awaitPromise) {
400
- const awaitValue = await awaitRef.promise;
401
- if (awaitRef.declareVariable) {
402
- awaitRef.node.declareVariable(stack, awaitValue);
403
- }
404
- else {
405
- awaitRef.node.set(stack, awaitValue);
383
+ let ArrowFunctionExpression = (() => {
384
+ let _classDecorators = [Deserializer('ArrowFunctionExpression')];
385
+ let _classDescriptor;
386
+ let _classExtraInitializers = [];
387
+ let _classThis;
388
+ let _classSuper = AbstractExpressionNode;
389
+ var ArrowFunctionExpression = class extends _classSuper {
390
+ static { _classThis = this; }
391
+ static {
392
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
393
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
394
+ ArrowFunctionExpression = _classThis = _classDescriptor.value;
395
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
396
+ __runInitializers(_classThis, _classExtraInitializers);
397
+ }
398
+ params;
399
+ body;
400
+ expression;
401
+ async;
402
+ static fromJSON(node, deserializer) {
403
+ return new ArrowFunctionExpression(node.params.map(deserializer), Array.isArray(node.body)
404
+ ? node.body.map(deserializer)
405
+ : deserializer(node.body), node.expression, node.async, node.range, node.loc);
406
+ }
407
+ static visit(node, visitNode) {
408
+ node.params.forEach(visitNode);
409
+ Array.isArray(node.body)
410
+ ? node.body.forEach(visitNode)
411
+ : visitNode(node.body);
412
+ }
413
+ generator = false;
414
+ constructor(params, body, expression, async, range, loc) {
415
+ super(range, loc);
416
+ this.params = params;
417
+ this.body = body;
418
+ this.expression = expression;
419
+ this.async = async;
420
+ }
421
+ getParams() {
422
+ return this.params;
423
+ }
424
+ getBody() {
425
+ return this.body;
426
+ }
427
+ getExpression() {
428
+ return this.expression;
429
+ }
430
+ set(stack, value) {
431
+ throw new Error('ArrowFunctionExpression#set() has no implementation.');
432
+ }
433
+ setParameter(stack, args) {
434
+ const rest = this.params[this.params.length - 1] instanceof RestElement;
435
+ const limit = rest ? this.params.length - 1 : this.params.length;
436
+ for (let i = 0; i < limit; i++) {
437
+ this.params[i].declareVariable(stack, args[i]);
438
+ }
439
+ if (rest) {
440
+ this.params[limit].declareVariable(stack, args.slice(limit));
441
+ }
442
+ }
443
+ get(stack) {
444
+ // freeze stack
445
+ stack = stack.copyStack();
446
+ return this.async ? this.getAsyncArrowFunction(stack) : this.getArrowFunction(stack);
447
+ }
448
+ getAsyncArrowFunction(gStack) {
449
+ async (...args) => {
450
+ const stack = gStack.copyStack();
451
+ stack.pushBlockScope();
452
+ this.setParameter(stack, args);
453
+ let returnValue;
454
+ const statements = Array.isArray(this.body) ? this.body : [this.body];
455
+ for (const state of statements) {
456
+ returnValue = state.get(stack);
457
+ if (stack.awaitPromise?.length > 0) {
458
+ for (const awaitRef of stack.awaitPromise) {
459
+ const awaitValue = await awaitRef.promise;
460
+ if (awaitRef.declareVariable) {
461
+ awaitRef.node.declareVariable(stack, awaitValue);
462
+ }
463
+ else {
464
+ awaitRef.node.set(stack, awaitValue);
465
+ }
406
466
  }
467
+ stack.awaitPromise.splice(0);
407
468
  }
408
- stack.awaitPromise.splice(0);
409
- }
410
- else if (stack.forAwaitAsyncIterable) {
411
- for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
412
- const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
413
- if (result instanceof TerminateReturnType) {
414
- if (result.type === 'continue') {
415
- continue;
469
+ else if (stack.forAwaitAsyncIterable) {
470
+ for await (let iterator of stack.forAwaitAsyncIterable.iterable) {
471
+ const result = stack.forAwaitAsyncIterable.forAwaitBody(iterator);
472
+ if (result instanceof TerminateReturnType) {
473
+ if (result.type === 'continue') {
474
+ continue;
475
+ }
476
+ else {
477
+ break;
478
+ }
416
479
  }
417
- else {
480
+ else if (result instanceof ReturnValue) {
481
+ returnValue = result;
418
482
  break;
419
483
  }
420
484
  }
421
- else if (result instanceof ReturnValue) {
422
- returnValue = result;
423
- break;
485
+ stack.forAwaitAsyncIterable = undefined;
486
+ }
487
+ if (returnValue instanceof ReturnValue) {
488
+ returnValue = returnValue.value;
489
+ if (returnValue instanceof AwaitPromise) {
490
+ return await returnValue.promise;
424
491
  }
425
492
  }
426
- stack.forAwaitAsyncIterable = undefined;
427
493
  }
428
- if (returnValue instanceof ReturnValue) {
429
- returnValue = returnValue.value;
430
- if (returnValue instanceof AwaitPromise) {
431
- return await returnValue.promise;
494
+ if (this.expression) {
495
+ return returnValue;
496
+ }
497
+ };
498
+ }
499
+ getArrowFunction(gStack) {
500
+ return (...args) => {
501
+ const stack = gStack.copyStack();
502
+ stack.pushBlockScope();
503
+ this.setParameter(stack, args);
504
+ let returnValue;
505
+ const statements = Array.isArray(this.body) ? this.body : [this.body];
506
+ for (const statement of statements) {
507
+ returnValue = statement.get(stack);
508
+ if (returnValue instanceof ReturnValue) {
509
+ return returnValue.value;
432
510
  }
433
511
  }
434
- }
435
- if (this.expression) {
436
- return returnValue;
437
- }
438
- };
439
- }
440
- getArrowFunction(gStack) {
441
- return (...args) => {
442
- const stack = gStack.copyStack();
443
- stack.pushBlockScope();
444
- this.setParameter(stack, args);
445
- let returnValue;
446
- const statements = Array.isArray(this.body) ? this.body : [this.body];
447
- for (const statement of statements) {
448
- returnValue = statement.get(stack);
449
- if (returnValue instanceof ReturnValue) {
450
- return returnValue.value;
512
+ if (this.expression) {
513
+ return returnValue;
451
514
  }
515
+ };
516
+ }
517
+ dependency(computed) {
518
+ return this.params.flatMap(param => param.dependency());
519
+ }
520
+ dependencyPath(computed) {
521
+ return this.params.flatMap(param => param.dependencyPath(computed));
522
+ }
523
+ toString() {
524
+ let str = this.async ? 'async ' : '';
525
+ if (this.params.length === 1) {
526
+ str += this.params[0].toString();
452
527
  }
453
- if (this.expression) {
454
- return returnValue;
528
+ else {
529
+ str += `(${this.params.map(param => param.toString()).join(', ')})`;
455
530
  }
456
- };
457
- }
458
- dependency(computed) {
459
- return this.params.flatMap(param => param.dependency());
460
- }
461
- dependencyPath(computed) {
462
- return this.params.flatMap(param => param.dependencyPath(computed));
463
- }
464
- toString() {
465
- let str = this.async ? 'async ' : '';
466
- if (this.params.length === 1) {
467
- str += this.params[0].toString();
468
- }
469
- else {
470
- str += `(${this.params.map(param => param.toString()).join(', ')})`;
471
- }
472
- str += ' => ';
473
- str += this.body.toString();
474
- return str;
475
- }
476
- toJson() {
477
- return {
478
- params: this.params.map(param => param.toJSON()),
479
- body: Array.isArray(this.body) ? this.body.map(item => item.toJSON()) : this.body.toJSON(),
480
- expression: true,
481
- async: this.async,
482
- generator: this.generator
483
- };
484
- }
485
- };
486
- ArrowFunctionExpression = ArrowFunctionExpression_1 = __decorate([
487
- Deserializer('ArrowFunctionExpression'),
488
- __metadata("design:paramtypes", [Array, Object, Boolean, Boolean, Array, Object])
489
- ], ArrowFunctionExpression);
531
+ str += ' => ';
532
+ str += this.body.toString();
533
+ return str;
534
+ }
535
+ toJson() {
536
+ return {
537
+ params: this.params.map(param => param.toJSON()),
538
+ body: Array.isArray(this.body) ? this.body.map(item => item.toJSON()) : this.body.toJSON(),
539
+ expression: true,
540
+ async: this.async,
541
+ generator: this.generator
542
+ };
543
+ }
544
+ };
545
+ return ArrowFunctionExpression = _classThis;
546
+ })();
490
547
  export { ArrowFunctionExpression };
491
548
  //# sourceMappingURL=function.js.map