@ibyar/expressions 0.8.5 → 1.0.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 (243) hide show
  1. package/api/abstract.d.ts +1 -0
  2. package/api/abstract.d.ts.map +1 -0
  3. package/api/abstract.js +12 -0
  4. package/api/abstract.js.map +1 -1
  5. package/api/class/class.d.ts +1 -0
  6. package/api/class/class.d.ts.map +1 -0
  7. package/api/class/class.js +563 -482
  8. package/api/class/class.js.map +1 -1
  9. package/api/class/decorator.d.ts +1 -0
  10. package/api/class/decorator.d.ts.map +1 -0
  11. package/api/class/decorator.js +49 -42
  12. package/api/class/decorator.js.map +1 -1
  13. package/api/computing/call.d.ts +1 -0
  14. package/api/computing/call.d.ts.map +1 -0
  15. package/api/computing/call.js +79 -70
  16. package/api/computing/call.js.map +1 -1
  17. package/api/computing/debugger.d.ts +1 -0
  18. package/api/computing/debugger.d.ts.map +1 -0
  19. package/api/computing/debugger.js +36 -29
  20. package/api/computing/debugger.js.map +1 -1
  21. package/api/computing/new.d.ts +1 -0
  22. package/api/computing/new.d.ts.map +1 -0
  23. package/api/computing/new.js +77 -69
  24. package/api/computing/new.js.map +1 -1
  25. package/api/computing/rest.d.ts +1 -0
  26. package/api/computing/rest.d.ts.map +1 -0
  27. package/api/computing/rest.js +50 -43
  28. package/api/computing/rest.js.map +1 -1
  29. package/api/computing/return.d.ts +1 -0
  30. package/api/computing/return.d.ts.map +1 -0
  31. package/api/computing/return.js +48 -41
  32. package/api/computing/return.js.map +1 -1
  33. package/api/computing/spread.d.ts +1 -0
  34. package/api/computing/spread.d.ts.map +1 -0
  35. package/api/computing/spread.js +66 -59
  36. package/api/computing/spread.js.map +1 -1
  37. package/api/computing/throw.d.ts +1 -0
  38. package/api/computing/throw.d.ts.map +1 -0
  39. package/api/computing/throw.js +204 -178
  40. package/api/computing/throw.js.map +1 -1
  41. package/api/computing/yield.d.ts +1 -0
  42. package/api/computing/yield.d.ts.map +1 -0
  43. package/api/computing/yield.js +56 -48
  44. package/api/computing/yield.js.map +1 -1
  45. package/api/definition/array.d.ts +1 -0
  46. package/api/definition/array.d.ts.map +1 -0
  47. package/api/definition/array.js +139 -124
  48. package/api/definition/array.js.map +1 -1
  49. package/api/definition/bind.d.ts +1 -0
  50. package/api/definition/bind.d.ts.map +1 -0
  51. package/api/definition/bind.js +81 -71
  52. package/api/definition/bind.js.map +1 -1
  53. package/api/definition/comment.d.ts +1 -0
  54. package/api/definition/comment.d.ts.map +1 -0
  55. package/api/definition/comment.js +40 -33
  56. package/api/definition/comment.js.map +1 -1
  57. package/api/definition/function.d.ts +1 -0
  58. package/api/definition/function.d.ts.map +1 -0
  59. package/api/definition/function.js +484 -447
  60. package/api/definition/function.js.map +1 -1
  61. package/api/definition/member.d.ts +1 -0
  62. package/api/definition/member.d.ts.map +1 -0
  63. package/api/definition/member.js +100 -90
  64. package/api/definition/member.js.map +1 -1
  65. package/api/definition/object.d.ts +1 -0
  66. package/api/definition/object.d.ts.map +1 -0
  67. package/api/definition/object.js +230 -202
  68. package/api/definition/object.js.map +1 -1
  69. package/api/definition/statement.d.ts +1 -0
  70. package/api/definition/statement.d.ts.map +1 -0
  71. package/api/definition/statement.js +52 -45
  72. package/api/definition/statement.js.map +1 -1
  73. package/api/definition/values.d.ts +1 -0
  74. package/api/definition/values.d.ts.map +1 -0
  75. package/api/definition/values.js +210 -167
  76. package/api/definition/values.js.map +1 -1
  77. package/api/deserialize/deserialize.d.ts +2 -1
  78. package/api/deserialize/deserialize.d.ts.map +1 -0
  79. package/api/deserialize/deserialize.js +5 -7
  80. package/api/deserialize/deserialize.js.map +1 -1
  81. package/api/deserialize/type-store.d.ts +1 -0
  82. package/api/deserialize/type-store.d.ts.map +1 -0
  83. package/api/expression.d.ts +1 -0
  84. package/api/expression.d.ts.map +1 -0
  85. package/api/index.d.ts +1 -0
  86. package/api/index.d.ts.map +1 -0
  87. package/api/module/common.d.ts +1 -0
  88. package/api/module/common.d.ts.map +1 -0
  89. package/api/module/common.js +59 -51
  90. package/api/module/common.js.map +1 -1
  91. package/api/module/export.d.ts +1 -0
  92. package/api/module/export.d.ts.map +1 -0
  93. package/api/module/export.js +327 -294
  94. package/api/module/export.js.map +1 -1
  95. package/api/module/import.d.ts +1 -0
  96. package/api/module/import.d.ts.map +1 -0
  97. package/api/module/import.js +298 -258
  98. package/api/module/import.js.map +1 -1
  99. package/api/operators/assignment.d.ts +1 -0
  100. package/api/operators/assignment.d.ts.map +1 -0
  101. package/api/operators/assignment.js +84 -75
  102. package/api/operators/assignment.js.map +1 -1
  103. package/api/operators/await.d.ts +1 -0
  104. package/api/operators/await.d.ts.map +1 -0
  105. package/api/operators/await.js +50 -43
  106. package/api/operators/await.js.map +1 -1
  107. package/api/operators/binary.d.ts +1 -0
  108. package/api/operators/binary.d.ts.map +1 -0
  109. package/api/operators/binary.js +74 -64
  110. package/api/operators/binary.js.map +1 -1
  111. package/api/operators/chaining.d.ts +1 -0
  112. package/api/operators/chaining.d.ts.map +1 -0
  113. package/api/operators/chaining.js +52 -45
  114. package/api/operators/chaining.js.map +1 -1
  115. package/api/operators/comma.d.ts +1 -0
  116. package/api/operators/comma.d.ts.map +1 -0
  117. package/api/operators/comma.js +49 -42
  118. package/api/operators/comma.js.map +1 -1
  119. package/api/operators/grouping.d.ts +1 -0
  120. package/api/operators/grouping.d.ts.map +1 -0
  121. package/api/operators/grouping.js +47 -40
  122. package/api/operators/grouping.js.map +1 -1
  123. package/api/operators/logical.d.ts +1 -0
  124. package/api/operators/logical.d.ts.map +1 -0
  125. package/api/operators/logical.js +47 -37
  126. package/api/operators/logical.js.map +1 -1
  127. package/api/operators/pipeline.d.ts +1 -0
  128. package/api/operators/pipeline.d.ts.map +1 -0
  129. package/api/operators/pipeline.js +91 -82
  130. package/api/operators/pipeline.js.map +1 -1
  131. package/api/operators/ternary.d.ts +1 -0
  132. package/api/operators/ternary.d.ts.map +1 -0
  133. package/api/operators/ternary.js +65 -56
  134. package/api/operators/ternary.js.map +1 -1
  135. package/api/operators/types.d.ts +1 -0
  136. package/api/operators/types.d.ts.map +1 -0
  137. package/api/operators/unary.d.ts +1 -0
  138. package/api/operators/unary.d.ts.map +1 -0
  139. package/api/operators/unary.js +93 -82
  140. package/api/operators/unary.js.map +1 -1
  141. package/api/operators/update.d.ts +1 -0
  142. package/api/operators/update.d.ts.map +1 -0
  143. package/api/operators/update.js +74 -62
  144. package/api/operators/update.js.map +1 -1
  145. package/api/program.d.ts +1 -0
  146. package/api/program.d.ts.map +1 -0
  147. package/api/program.js +49 -41
  148. package/api/program.js.map +1 -1
  149. package/api/statement/control/block.d.ts +1 -0
  150. package/api/statement/control/block.d.ts.map +1 -0
  151. package/api/statement/control/block.js +61 -54
  152. package/api/statement/control/block.js.map +1 -1
  153. package/api/statement/control/empty.d.ts +1 -1
  154. package/api/statement/control/empty.d.ts.map +1 -0
  155. package/api/statement/control/empty.js +39 -34
  156. package/api/statement/control/empty.js.map +1 -1
  157. package/api/statement/control/if.d.ts +1 -0
  158. package/api/statement/control/if.d.ts.map +1 -0
  159. package/api/statement/control/if.js +75 -66
  160. package/api/statement/control/if.js.map +1 -1
  161. package/api/statement/control/switch.d.ts +1 -0
  162. package/api/statement/control/switch.d.ts.map +1 -0
  163. package/api/statement/control/switch.js +168 -144
  164. package/api/statement/control/switch.js.map +1 -1
  165. package/api/statement/control/terminate.d.ts +1 -2
  166. package/api/statement/control/terminate.d.ts.map +1 -0
  167. package/api/statement/control/terminate.js +105 -81
  168. package/api/statement/control/terminate.js.map +1 -1
  169. package/api/statement/control/with.d.ts +1 -0
  170. package/api/statement/control/with.d.ts.map +1 -0
  171. package/api/statement/control/with.js +68 -60
  172. package/api/statement/control/with.js.map +1 -1
  173. package/api/statement/declarations/declares.d.ts +1 -0
  174. package/api/statement/declarations/declares.d.ts.map +1 -0
  175. package/api/statement/declarations/declares.js +140 -123
  176. package/api/statement/declarations/declares.js.map +1 -1
  177. package/api/statement/iterations/for.d.ts +1 -0
  178. package/api/statement/iterations/for.d.ts.map +1 -0
  179. package/api/statement/iterations/for.js +320 -280
  180. package/api/statement/iterations/for.js.map +1 -1
  181. package/api/statement/iterations/while.d.ts +1 -0
  182. package/api/statement/iterations/while.d.ts.map +1 -0
  183. package/api/statement/iterations/while.js +144 -127
  184. package/api/statement/iterations/while.js.map +1 -1
  185. package/api/utils.d.ts +1 -0
  186. package/api/utils.d.ts.map +1 -0
  187. package/index.d.ts +1 -0
  188. package/index.d.ts.map +1 -0
  189. package/package.json +5 -5
  190. package/scope/event.d.ts +1 -0
  191. package/scope/event.d.ts.map +1 -0
  192. package/scope/finalizer.d.ts +1 -0
  193. package/scope/finalizer.d.ts.map +1 -0
  194. package/scope/index.d.ts +1 -0
  195. package/scope/index.d.ts.map +1 -0
  196. package/scope/pool.d.ts +1 -0
  197. package/scope/pool.d.ts.map +1 -0
  198. package/scope/proxy.d.ts +1 -0
  199. package/scope/proxy.d.ts.map +1 -0
  200. package/scope/proxy.js +1 -0
  201. package/scope/proxy.js.map +1 -1
  202. package/scope/scope.d.ts +1 -0
  203. package/scope/scope.d.ts.map +1 -0
  204. package/scope/scope.js +17 -11
  205. package/scope/scope.js.map +1 -1
  206. package/scope/stack.d.ts +1 -0
  207. package/scope/stack.d.ts.map +1 -0
  208. package/scope/stack.js +21 -13
  209. package/scope/stack.js.map +1 -1
  210. package/v8/enums.d.ts +1 -0
  211. package/v8/enums.d.ts.map +1 -0
  212. package/v8/enums.js +15 -13
  213. package/v8/enums.js.map +1 -1
  214. package/v8/factory.d.ts +1 -0
  215. package/v8/factory.d.ts.map +1 -0
  216. package/v8/factory.js +6 -4
  217. package/v8/factory.js.map +1 -1
  218. package/v8/index.d.ts +1 -0
  219. package/v8/index.d.ts.map +1 -0
  220. package/v8/inline.d.ts +1 -0
  221. package/v8/inline.d.ts.map +1 -0
  222. package/v8/inline.js +10 -6
  223. package/v8/inline.js.map +1 -1
  224. package/v8/language.d.ts +1 -0
  225. package/v8/language.d.ts.map +1 -0
  226. package/v8/node.d.ts +1 -0
  227. package/v8/node.d.ts.map +1 -0
  228. package/v8/parser.d.ts +1 -0
  229. package/v8/parser.d.ts.map +1 -0
  230. package/v8/parser.js +5 -5
  231. package/v8/parser.js.map +1 -1
  232. package/v8/stream.d.ts +1 -0
  233. package/v8/stream.d.ts.map +1 -0
  234. package/v8/stream.js +19 -8
  235. package/v8/stream.js.map +1 -1
  236. package/v8/token.d.ts +1 -0
  237. package/v8/token.d.ts.map +1 -0
  238. package/v8/token.js +365 -359
  239. package/v8/token.js.map +1 -1
  240. package/visit/index.d.ts +1 -0
  241. package/visit/index.d.ts.map +1 -0
  242. package/visit/visitor.d.ts +1 -0
  243. package/visit/visitor.d.ts.map +1 -0
@@ -1,45 +1,45 @@
1
- var Super_1, MetaProperty_1, PrivateIdentifier_1, StaticBlock_1, MethodDefinition_1, PropertyDefinition_1, AccessorProperty_1, ClassBody_1, ClassDeclaration_1, ClassExpression_1;
2
- import { __decorate, __metadata } from "tslib";
1
+ import { __esDecorate, __runInitializers } from "tslib";
3
2
  import { AbstractExpressionNode } from '../abstract.js';
4
3
  import { Deserializer } from '../deserialize/deserialize.js';
5
4
  import { Identifier } from '../definition/values.js';
6
- import { FunctionExpression } from '../definition/function.js';
7
5
  import { BlockStatement } from '../statement/control/block.js';
8
6
  import { CallExpression } from '../computing/call.js';
9
7
  const TEMP_CLASS_NAME = Symbol('TempClassName');
10
8
  const PRIVATE_SYMBOL = Symbol('#');
11
9
  ;
12
10
  class ClassInitializer {
13
- constructor() {
14
- /**
15
- * register class public static properties and methods
16
- */
17
- this.staticInitializer = {};
18
- /**
19
- * register class private static properties and methods
20
- */
21
- this.staticPrivateInitializer = {};
22
- /**
23
- * register static initialization block
24
- */
25
- this.staticInitializerBlock = [];
26
- /**
27
- * register super parameter resolver
28
- */
29
- this.superParameterResolver = (params) => params;
30
- /**
31
- * register in class property
32
- */
33
- this.instanceMethod = {};
34
- /**
35
- * register method in instance private space
36
- */
37
- this.privateInstanceMethod = {};
38
- /**
39
- * register property in instance itself
40
- */
41
- this.instanceInitializer = [];
42
- }
11
+ /**
12
+ * register class public static properties and methods
13
+ */
14
+ staticInitializer = {};
15
+ /**
16
+ * register class private static properties and methods
17
+ */
18
+ staticPrivateInitializer = {};
19
+ /**
20
+ * register static initialization block
21
+ */
22
+ staticInitializerBlock = [];
23
+ /**
24
+ * register class constructor function
25
+ */
26
+ instanceConstructor;
27
+ /**
28
+ * register super parameter resolver
29
+ */
30
+ superParameterResolver = (params) => params;
31
+ /**
32
+ * register in class property
33
+ */
34
+ instanceMethod = {};
35
+ /**
36
+ * register method in instance private space
37
+ */
38
+ privateInstanceMethod = {};
39
+ /**
40
+ * register property in instance itself
41
+ */
42
+ instanceInitializer = [];
43
43
  addStaticInitializer(key, attributes) {
44
44
  Reflect.set(this.staticInitializer, key, attributes);
45
45
  }
@@ -86,37 +86,44 @@ class ClassInitializer {
86
86
  /**
87
87
  * A `super` pseudo-expression.
88
88
  */
89
- let Super = Super_1 = class Super extends AbstractExpressionNode {
90
- static fromJSON(node) {
91
- return new Super_1(node.range, node.loc);
92
- }
93
- constructor(range, loc) {
94
- super(range, loc);
95
- }
96
- set(stack, value) {
97
- throw new Error('Super.#set() Method not implemented.');
98
- }
99
- get(stack, thisContext) {
100
- return stack.get('super');
101
- }
102
- dependency(computed) {
103
- throw new Error('Super.#dependency() Method not implemented.');
104
- }
105
- dependencyPath(computed) {
106
- throw new Error('Super.#dependencyPath() Method not implemented.');
107
- }
108
- toString() {
109
- return `super`;
110
- }
111
- toJson() {
112
- return {};
113
- }
114
- };
115
- Super = Super_1 = __decorate([
116
- Deserializer('Super'),
117
- __metadata("design:paramtypes", [Array, Object])
118
- ], Super);
119
- export { Super };
89
+ export let Super = (() => {
90
+ let _classDecorators = [Deserializer('Super')];
91
+ let _classDescriptor;
92
+ let _classExtraInitializers = [];
93
+ let _classThis;
94
+ var Super = class extends AbstractExpressionNode {
95
+ static {
96
+ __esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
97
+ Super = _classThis = _classDescriptor.value;
98
+ __runInitializers(_classThis, _classExtraInitializers);
99
+ }
100
+ static fromJSON(node) {
101
+ return new Super(node.range, node.loc);
102
+ }
103
+ constructor(range, loc) {
104
+ super(range, loc);
105
+ }
106
+ set(stack, value) {
107
+ throw new Error('Super.#set() Method not implemented.');
108
+ }
109
+ get(stack, thisContext) {
110
+ return stack.get('super');
111
+ }
112
+ dependency(computed) {
113
+ throw new Error('Super.#dependency() Method not implemented.');
114
+ }
115
+ dependencyPath(computed) {
116
+ throw new Error('Super.#dependencyPath() Method not implemented.');
117
+ }
118
+ toString() {
119
+ return `super`;
120
+ }
121
+ toJson() {
122
+ return {};
123
+ }
124
+ };
125
+ return Super = _classThis;
126
+ })();
120
127
  /**
121
128
  * MetaProperty node represents
122
129
  * - `new.target` meta property in ES2015.
@@ -124,102 +131,132 @@ export { Super };
124
131
  *
125
132
  * In the future, it will represent other meta properties as well.
126
133
  */
127
- let MetaProperty = MetaProperty_1 = class MetaProperty extends AbstractExpressionNode {
128
- static fromJSON(node, deserializer) {
129
- return new MetaProperty_1(deserializer(node.meta), deserializer(node.property), node.range, node.loc);
130
- }
131
- static visit(node, visitNode) {
132
- visitNode(node.meta);
133
- visitNode(node.property);
134
- }
135
- constructor(meta, property, range, loc) {
136
- super(range, loc);
137
- this.meta = meta;
138
- this.property = property;
139
- }
140
- getMeta() {
141
- return this.meta;
142
- }
143
- getProperty() {
144
- return this.property;
145
- }
146
- get(stack) {
147
- const metaRef = this.meta.get(stack);
148
- if (metaRef === undefined || metaRef === null) {
149
- throw new TypeError(`Cannot read meta property '${this.property.toString()}' of ${metaRef}, reading [${this.toString()}]`);
134
+ export let MetaProperty = (() => {
135
+ let _classDecorators_1 = [Deserializer('MetaProperty')];
136
+ let _classDescriptor_1;
137
+ let _classExtraInitializers_1 = [];
138
+ let _classThis_1;
139
+ var MetaProperty = class extends AbstractExpressionNode {
140
+ static {
141
+ __esDecorate(null, _classDescriptor_1 = { value: this }, _classDecorators_1, { kind: "class", name: this.name }, null, _classExtraInitializers_1);
142
+ MetaProperty = _classThis_1 = _classDescriptor_1.value;
143
+ __runInitializers(_classThis_1, _classExtraInitializers_1);
150
144
  }
151
- return this.property.get(stack, metaRef);
152
- }
153
- set(stack, value) {
154
- throw new Error(`MetaProperty#set() has no implementation.`);
155
- }
156
- dependency(computed) {
157
- return [];
158
- }
159
- dependencyPath(computed) {
160
- return [];
161
- }
162
- toString() {
163
- return `${this.meta.toString()}.${this.property.toString()}`;
164
- }
165
- toJson() {
166
- return {
167
- meta: this.meta.toJSON(),
168
- property: this.property.toJSON(),
169
- };
170
- }
171
- };
172
- MetaProperty = MetaProperty_1 = __decorate([
173
- Deserializer('MetaProperty'),
174
- __metadata("design:paramtypes", [Identifier, Identifier, Array, Object])
175
- ], MetaProperty);
176
- export { MetaProperty };
145
+ meta;
146
+ property;
147
+ static fromJSON(node, deserializer) {
148
+ return new MetaProperty(deserializer(node.meta), deserializer(node.property), node.range, node.loc);
149
+ }
150
+ static visit(node, visitNode) {
151
+ visitNode(node.meta);
152
+ visitNode(node.property);
153
+ }
154
+ constructor(meta, property, range, loc) {
155
+ super(range, loc);
156
+ this.meta = meta;
157
+ this.property = property;
158
+ }
159
+ getMeta() {
160
+ return this.meta;
161
+ }
162
+ getProperty() {
163
+ return this.property;
164
+ }
165
+ get(stack) {
166
+ const metaRef = this.meta.get(stack);
167
+ if (metaRef === undefined || metaRef === null) {
168
+ throw new TypeError(`Cannot read meta property '${this.property.toString()}' of ${metaRef}, reading [${this.toString()}]`);
169
+ }
170
+ return this.property.get(stack, metaRef);
171
+ }
172
+ set(stack, value) {
173
+ throw new Error(`MetaProperty#set() has no implementation.`);
174
+ }
175
+ dependency(computed) {
176
+ return [];
177
+ }
178
+ dependencyPath(computed) {
179
+ return [];
180
+ }
181
+ toString() {
182
+ return `${this.meta.toString()}.${this.property.toString()}`;
183
+ }
184
+ toJson() {
185
+ return {
186
+ meta: this.meta.toJSON(),
187
+ property: this.property.toJSON(),
188
+ };
189
+ }
190
+ };
191
+ return MetaProperty = _classThis_1;
192
+ })();
177
193
  /**
178
194
  * A private identifier refers to private class elements. For a private name `#a`, its name is `a`.
179
195
  */
180
- let PrivateIdentifier = PrivateIdentifier_1 = class PrivateIdentifier extends Identifier {
181
- static fromJSON(node) {
182
- return new PrivateIdentifier_1(node.name, node.range, node.loc);
183
- }
184
- get(stack, thisContext) {
185
- return thisContext[PRIVATE_SYMBOL][this.name];
186
- }
187
- set(stack, value) {
188
- const thisContext = stack.lastScope().getContext();
189
- return thisContext[PRIVATE_SYMBOL][this.name] = value;
190
- }
191
- toString() {
192
- return `#${this.name}`;
193
- }
194
- };
195
- PrivateIdentifier = PrivateIdentifier_1 = __decorate([
196
- Deserializer('PrivateIdentifier')
197
- ], PrivateIdentifier);
198
- export { PrivateIdentifier };
196
+ export let PrivateIdentifier = (() => {
197
+ let _classDecorators_2 = [Deserializer('PrivateIdentifier')];
198
+ let _classDescriptor_2;
199
+ let _classExtraInitializers_2 = [];
200
+ let _classThis_2;
201
+ var PrivateIdentifier = class extends Identifier {
202
+ static {
203
+ __esDecorate(null, _classDescriptor_2 = { value: this }, _classDecorators_2, { kind: "class", name: this.name }, null, _classExtraInitializers_2);
204
+ PrivateIdentifier = _classThis_2 = _classDescriptor_2.value;
205
+ __runInitializers(_classThis_2, _classExtraInitializers_2);
206
+ }
207
+ static fromJSON(node) {
208
+ return new PrivateIdentifier(node.name, node.range, node.loc);
209
+ }
210
+ get(stack, thisContext) {
211
+ return thisContext[PRIVATE_SYMBOL][this.name];
212
+ }
213
+ set(stack, value) {
214
+ const thisContext = stack.lastScope().getContext();
215
+ return thisContext[PRIVATE_SYMBOL][this.name] = value;
216
+ }
217
+ toString() {
218
+ return `#${this.name}`;
219
+ }
220
+ };
221
+ return PrivateIdentifier = _classThis_2;
222
+ })();
199
223
  /**
200
224
  * A static block static { } is a block statement serving as an additional static initializer.
201
225
  */
202
- let StaticBlock = StaticBlock_1 = class StaticBlock extends BlockStatement {
203
- static fromJSON(node, deserializer) {
204
- return new StaticBlock_1(deserializer(node.body), node.range, node.loc);
205
- }
206
- get(stack, classInitializer) {
207
- classInitializer?.addStaticInitializerBlock(super.get(stack));
208
- }
209
- toString() {
210
- return `static ${super.toString()}`;
211
- }
212
- toJson() {
213
- return {
214
- body: this.body.map(node => node.toJSON())
215
- };
216
- }
217
- };
218
- StaticBlock = StaticBlock_1 = __decorate([
219
- Deserializer('StaticBlock')
220
- ], StaticBlock);
221
- export { StaticBlock };
226
+ export let StaticBlock = (() => {
227
+ let _classDecorators_3 = [Deserializer('StaticBlock')];
228
+ let _classDescriptor_3;
229
+ let _classExtraInitializers_3 = [];
230
+ let _classThis_3;
231
+ var StaticBlock = class extends BlockStatement {
232
+ static {
233
+ __esDecorate(null, _classDescriptor_3 = { value: this }, _classDecorators_3, { kind: "class", name: this.name }, null, _classExtraInitializers_3);
234
+ StaticBlock = _classThis_3 = _classDescriptor_3.value;
235
+ __runInitializers(_classThis_3, _classExtraInitializers_3);
236
+ }
237
+ static fromJSON(node, deserializer) {
238
+ return new StaticBlock(deserializer(node.body), node.range, node.loc);
239
+ }
240
+ get(stack, classInitializer) {
241
+ classInitializer?.addStaticInitializerBlock(super.get(stack));
242
+ }
243
+ toString() {
244
+ return `static ${super.toString()}`;
245
+ }
246
+ toJson() {
247
+ return {
248
+ body: this.body.map(node => node.toJSON())
249
+ };
250
+ }
251
+ };
252
+ return StaticBlock = _classThis_3;
253
+ })();
222
254
  export class AbstractDefinition extends AbstractExpressionNode {
255
+ key;
256
+ decorators;
257
+ computed;
258
+ value;
259
+ 'static';
223
260
  constructor(key, decorators, computed, isStatic, value, range, loc) {
224
261
  super(range, loc);
225
262
  this.key = key;
@@ -269,291 +306,326 @@ export class AbstractDefinition extends AbstractExpressionNode {
269
306
  /**
270
307
  * - When key is a PrivateIdentifier, computed must be false and kind can not be "constructor".
271
308
  */
272
- let MethodDefinition = MethodDefinition_1 = class MethodDefinition extends AbstractDefinition {
273
- static fromJSON(node, deserializer) {
274
- return new MethodDefinition_1(node.kind, deserializer(node.key), deserializer(node.value), node.decorators.map(deserializer), node.computed, node.static, node.range, node.loc);
275
- }
276
- static visit(node, visitNode) {
277
- visitNode(node.key);
278
- visitNode(node.value);
279
- node.decorators.forEach(visitNode);
280
- }
281
- constructor(kind, key, value, decorators, computed, isStatic, range, loc) {
282
- super(key, decorators, computed, isStatic, value, range, loc);
283
- this.kind = kind;
284
- }
285
- getKind() {
286
- return this.kind;
287
- }
288
- getValue() {
289
- return this.value;
290
- }
291
- get(stack, initializer) {
292
- if (this.kind === 'constructor') {
293
- this.initConstructor(stack, initializer);
294
- return;
309
+ export let MethodDefinition = (() => {
310
+ let _classDecorators_4 = [Deserializer('MethodDefinition')];
311
+ let _classDescriptor_4;
312
+ let _classExtraInitializers_4 = [];
313
+ let _classThis_4;
314
+ var MethodDefinition = class extends AbstractDefinition {
315
+ static {
316
+ __esDecorate(null, _classDescriptor_4 = { value: this }, _classDecorators_4, { kind: "class", name: this.name }, null, _classExtraInitializers_4);
317
+ MethodDefinition = _classThis_4 = _classDescriptor_4.value;
318
+ __runInitializers(_classThis_4, _classExtraInitializers_4);
295
319
  }
296
- const name = this.getKeyName(stack);
297
- const value = this.value?.get(stack);
298
- const attributes = this.getPropertyAttributes(value);
299
- if (this.isStatic() && this.isPrivate()) {
300
- initializer.addStaticPrivateInitializer(name, attributes);
320
+ kind;
321
+ static fromJSON(node, deserializer) {
322
+ return new MethodDefinition(node.kind, deserializer(node.key), deserializer(node.value), node.decorators.map(deserializer), node.computed, node.static, node.range, node.loc);
301
323
  }
302
- else if (this.isStatic()) {
303
- initializer.addStaticInitializer(name, attributes);
324
+ static visit(node, visitNode) {
325
+ visitNode(node.key);
326
+ visitNode(node.value);
327
+ node.decorators.forEach(visitNode);
304
328
  }
305
- else if (this.isPrivate()) {
306
- initializer.addPrivateInstanceMethod(name, attributes);
329
+ afterInstanceConstruct;
330
+ constructor(kind, key, value, decorators, computed, isStatic, range, loc) {
331
+ super(key, decorators, computed, isStatic, value, range, loc);
332
+ this.kind = kind;
307
333
  }
308
- else {
309
- initializer.addInstanceMethod(name, attributes);
334
+ getKind() {
335
+ return this.kind;
310
336
  }
311
- }
312
- getPropertyAttributes(value) {
313
- switch (this.kind) {
314
- case 'set': return {
315
- writable: true,
316
- configurable: true,
317
- enumerable: false,
318
- set: value,
319
- };
320
- case 'get': return {
321
- writable: true,
322
- configurable: true,
323
- enumerable: false,
324
- get: value,
325
- };
326
- default:
327
- case 'method': return {
328
- writable: true,
329
- configurable: true,
330
- enumerable: false,
331
- value: value
332
- };
337
+ getValue() {
338
+ return this.value;
333
339
  }
334
- }
335
- initConstructor(stack, initializer) {
336
- const body = this.value.getBody().getBody();
337
- let superIndex = body
338
- .findIndex(call => call instanceof CallExpression && call.getCallee() instanceof Super);
339
- const blockAfterSuper = new BlockStatement(body.slice(superIndex + 1));
340
- initializer.setConstructor(function (params) {
341
- const scope = stack.pushBlockScope();
342
- blockAfterSuper.get(stack);
343
- stack.clearTo(scope);
344
- });
345
- if (superIndex >= 0) {
346
- const blockBeforeSuper = new BlockStatement(body.slice(0, superIndex));
347
- const superCall = body[superIndex];
348
- const cstrExpr = this;
349
- initializer.setParameterResolver(function (params) {
340
+ get(stack, initializer) {
341
+ if (this.kind === 'constructor') {
342
+ this.initConstructor(stack, initializer);
343
+ return;
344
+ }
345
+ const name = this.getKeyName(stack);
346
+ const value = this.value?.get(stack);
347
+ const attributes = this.getPropertyAttributes(value);
348
+ if (this.isStatic() && this.isPrivate()) {
349
+ initializer.addStaticPrivateInitializer(name, attributes);
350
+ }
351
+ else if (this.isStatic()) {
352
+ initializer.addStaticInitializer(name, attributes);
353
+ }
354
+ else if (this.isPrivate()) {
355
+ initializer.addPrivateInstanceMethod(name, attributes);
356
+ }
357
+ else {
358
+ initializer.addInstanceMethod(name, attributes);
359
+ }
360
+ }
361
+ getPropertyAttributes(value) {
362
+ switch (this.kind) {
363
+ case 'set': return {
364
+ writable: true,
365
+ configurable: true,
366
+ enumerable: false,
367
+ set: value,
368
+ };
369
+ case 'get': return {
370
+ writable: true,
371
+ configurable: true,
372
+ enumerable: false,
373
+ get: value,
374
+ };
375
+ default:
376
+ case 'method': return {
377
+ writable: true,
378
+ configurable: true,
379
+ enumerable: false,
380
+ value: value
381
+ };
382
+ }
383
+ }
384
+ initConstructor(stack, initializer) {
385
+ const body = this.value.getBody().getBody();
386
+ let superIndex = body
387
+ .findIndex(call => call instanceof CallExpression && call.getCallee() instanceof Super);
388
+ const blockAfterSuper = new BlockStatement(body.slice(superIndex + 1));
389
+ initializer.setConstructor(function (params) {
350
390
  const scope = stack.pushBlockScope();
351
- cstrExpr.value.defineFunctionArguments(stack, params);
352
- blockBeforeSuper.get(stack);
353
- const parameters = superCall.getCallParameters(stack);
391
+ blockAfterSuper.get(stack);
354
392
  stack.clearTo(scope);
355
- return parameters;
356
393
  });
394
+ if (superIndex >= 0) {
395
+ const blockBeforeSuper = new BlockStatement(body.slice(0, superIndex));
396
+ const superCall = body[superIndex];
397
+ const cstrExpr = this;
398
+ initializer.setParameterResolver(function (params) {
399
+ const scope = stack.pushBlockScope();
400
+ cstrExpr.value.defineFunctionArguments(stack, params);
401
+ blockBeforeSuper.get(stack);
402
+ const parameters = superCall.getCallParameters(stack);
403
+ stack.clearTo(scope);
404
+ return parameters;
405
+ });
406
+ }
357
407
  }
358
- }
359
- toString() {
360
- let str = this.decorators.map(decorator => decorator.toString()).join(' ');
361
- if (str.length) {
362
- str += ' ';
363
- }
364
- if (this.static) {
365
- str += 'static ';
366
- }
367
- const methodName = this.key.toString();
368
- switch (this.kind) {
369
- case 'get':
370
- str += 'get ' + methodName;
371
- break;
372
- case 'set':
373
- str += 'set ' + methodName;
374
- break;
375
- case 'method':
376
- if (this.value.getAsync() && this.value.getGenerator()) {
377
- str += 'async *';
378
- }
379
- else if (this.value.getAsync()) {
380
- str += 'async ';
381
- }
382
- else if (this.value.getGenerator()) {
383
- str += '*';
384
- }
385
- str += methodName;
386
- break;
387
- case 'constructor':
388
- str += 'constructor';
389
- break;
390
- default:
391
- break;
408
+ toString() {
409
+ let str = this.decorators.map(decorator => decorator.toString()).join(' ');
410
+ if (str.length) {
411
+ str += ' ';
412
+ }
413
+ if (this.static) {
414
+ str += 'static ';
415
+ }
416
+ const methodName = this.key.toString();
417
+ switch (this.kind) {
418
+ case 'get':
419
+ str += 'get ' + methodName;
420
+ break;
421
+ case 'set':
422
+ str += 'set ' + methodName;
423
+ break;
424
+ case 'method':
425
+ if (this.value.getAsync() && this.value.getGenerator()) {
426
+ str += 'async *';
427
+ }
428
+ else if (this.value.getAsync()) {
429
+ str += 'async ';
430
+ }
431
+ else if (this.value.getGenerator()) {
432
+ str += '*';
433
+ }
434
+ str += methodName;
435
+ break;
436
+ case 'constructor':
437
+ str += 'constructor';
438
+ break;
439
+ default:
440
+ break;
441
+ }
442
+ str += this.value.paramsAndBodyToString();
443
+ return str;
392
444
  }
393
- str += this.value.paramsAndBodyToString();
394
- return str;
395
- }
396
- toJson() {
397
- return {
398
- kind: this.kind,
399
- key: this.key.toJSON(),
400
- value: this.value.toJSON(),
401
- decorators: this.decorators.map(decorator => decorator.toJSON()),
402
- computed: this.computed,
403
- static: this.static,
404
- };
405
- }
406
- };
407
- MethodDefinition = MethodDefinition_1 = __decorate([
408
- Deserializer('MethodDefinition'),
409
- __metadata("design:paramtypes", [String, Object, FunctionExpression, Array, Boolean, Boolean, Array, Object])
410
- ], MethodDefinition);
411
- export { MethodDefinition };
445
+ toJson() {
446
+ return {
447
+ kind: this.kind,
448
+ key: this.key.toJSON(),
449
+ value: this.value.toJSON(),
450
+ decorators: this.decorators.map(decorator => decorator.toJSON()),
451
+ computed: this.computed,
452
+ static: this.static,
453
+ };
454
+ }
455
+ };
456
+ return MethodDefinition = _classThis_4;
457
+ })();
412
458
  /**
413
459
  * - When key is a PrivateIdentifier, computed must be false.
414
460
  */
415
- let PropertyDefinition = PropertyDefinition_1 = class PropertyDefinition extends AbstractDefinition {
416
- static fromJSON(node, deserializer) {
417
- return new PropertyDefinition_1(deserializer(node.key), node.decorators.map(deserializer), node.computed, node.static, node.value && deserializer(node.value), node.range, node.loc);
418
- }
419
- static visit(node, visitNode) {
420
- visitNode(node.key);
421
- node.value && visitNode(node.value);
422
- }
423
- constructor(key, decorators, computed, isStatic, value, range, loc) {
424
- super(key, decorators, computed, isStatic, value, range, loc);
425
- }
426
- get(stack, initializer) {
427
- const name = this.getKeyName(stack);
428
- if (!this.isStatic()) {
429
- initializer.addInstanceInitializer(() => ({ isPrivate: this.isPrivate(), key: name, value: this.value?.get(stack) }));
430
- return;
461
+ export let PropertyDefinition = (() => {
462
+ let _classDecorators_5 = [Deserializer('PropertyDefinition')];
463
+ let _classDescriptor_5;
464
+ let _classExtraInitializers_5 = [];
465
+ let _classThis_5;
466
+ var PropertyDefinition = class extends AbstractDefinition {
467
+ static {
468
+ __esDecorate(null, _classDescriptor_5 = { value: this }, _classDecorators_5, { kind: "class", name: this.name }, null, _classExtraInitializers_5);
469
+ PropertyDefinition = _classThis_5 = _classDescriptor_5.value;
470
+ __runInitializers(_classThis_5, _classExtraInitializers_5);
431
471
  }
432
- const value = this.value?.get(stack);
433
- const attributes = { writable: true, configurable: true, enumerable: true, value };
434
- if (this.isPrivate()) {
435
- initializer.addStaticPrivateInitializer(name, attributes);
472
+ static fromJSON(node, deserializer) {
473
+ return new PropertyDefinition(deserializer(node.key), node.decorators.map(deserializer), node.computed, node.static, node.value && deserializer(node.value), node.range, node.loc);
436
474
  }
437
- else {
438
- initializer.addStaticInitializer(name, attributes);
475
+ static visit(node, visitNode) {
476
+ visitNode(node.key);
477
+ node.value && visitNode(node.value);
439
478
  }
440
- }
441
- toString() {
442
- const decorators = this.decorators.map(decorator => decorator.toString()).join('\n');
443
- const name = this.computed ? `[${this.key.toString()}]` : this.key.toString();
444
- return `${decorators.length ? decorators + ' ' : ''}${this.static ? 'static ' : ''}${name}${this.value ? ` = ${this.value.toString()}` : ''};`;
445
- }
446
- toJson() {
447
- return {
448
- key: this.key.toJSON(),
449
- value: this.value?.toJSON(),
450
- decorators: this.decorators.map(decorator => decorator.toJSON()),
451
- computed: this.computed,
452
- static: this.static,
453
- };
454
- }
455
- };
456
- PropertyDefinition = PropertyDefinition_1 = __decorate([
457
- Deserializer('PropertyDefinition'),
458
- __metadata("design:paramtypes", [Object, Array, Boolean, Boolean, Object, Array, Object])
459
- ], PropertyDefinition);
460
- export { PropertyDefinition };
461
- let AccessorProperty = AccessorProperty_1 = class AccessorProperty extends AbstractDefinition {
462
- static fromJSON(node, deserializer) {
463
- return new AccessorProperty_1(deserializer(node.key), node.decorators.map(deserializer), node.computed, node.static, node.value ? deserializer(node.value) : void 0, node.range, node.loc);
464
- }
465
- static visit(node, visitNode) {
466
- visitNode(node.key);
467
- node.value && visitNode(node.value);
468
- node.decorators.forEach(visitNode);
469
- }
470
- constructor(key, decorators, computed, isStatic, value, range, loc) {
471
- super(key, decorators, computed, isStatic, value, range, loc);
472
- }
473
- get(stack, initializer) {
474
- const name = this.getKeyName(stack);
475
- const accessorAttributes = {
476
- writable: false,
477
- configurable: true,
478
- enumerable: false,
479
- set: function (value) {
480
- this[PRIVATE_SYMBOL][name] = value;
481
- },
482
- get: function () {
483
- return this[PRIVATE_SYMBOL][name];
484
- },
485
- };
486
- if (!this.isStatic()) {
487
- initializer.addInstanceInitializer(() => ({ isPrivate: true, key: name, value: this.value?.get(stack) }));
488
- initializer.addInstanceMethod(name, accessorAttributes);
489
- return;
479
+ constructor(key, decorators, computed, isStatic, value, range, loc) {
480
+ super(key, decorators, computed, isStatic, value, range, loc);
490
481
  }
491
- const value = this.value?.get(stack);
492
- const valueAttribute = { writable: true, configurable: true, enumerable: true, value };
493
- initializer.addStaticInitializer(name, accessorAttributes);
494
- initializer.addStaticPrivateInitializer(name, valueAttribute);
495
- }
496
- toString() {
497
- const decorators = this.decorators.map(decorator => decorator.toString()).join('\n');
498
- const name = this.computed ? `[${this.key.toString()}]` : this.key.toString();
499
- return `${decorators.length ? decorators.concat(' ') : ''}${this.static ? 'static ' : ''}accessor ${name}${this.value ? ` = ${this.value.toString()}` : ''};`;
500
- }
501
- toJson() {
502
- return {
503
- key: this.key.toJSON(),
504
- decorators: this.decorators.map(decorator => decorator.toJSON()),
505
- computed: this.computed,
506
- static: this.static,
507
- value: this.value?.toJSON(),
508
- };
509
- }
510
- };
511
- AccessorProperty = AccessorProperty_1 = __decorate([
512
- Deserializer('AccessorProperty'),
513
- __metadata("design:paramtypes", [Object, Array, Boolean, Boolean, Object, Array, Object])
514
- ], AccessorProperty);
515
- export { AccessorProperty };
516
- let ClassBody = ClassBody_1 = class ClassBody extends AbstractExpressionNode {
517
- static fromJSON(node, deserializer) {
518
- return new ClassBody_1(node.body.map(deserializer), node.range, node.loc);
519
- }
520
- static visit(node, visitNode) {
521
- node.body.forEach(visitNode);
522
- }
523
- constructor(body, range, loc) {
524
- super(range, loc);
525
- this.body = body;
526
- }
527
- getBody() {
528
- return this.body;
529
- }
530
- set(stack, value) {
531
- throw new Error('Method not implemented.');
532
- }
533
- get(stack, initializer) {
534
- this.body.forEach(definition => definition.get(stack, initializer));
535
- }
536
- dependency(computed) {
537
- throw new Error('Method not implemented.');
538
- }
539
- dependencyPath(computed) {
540
- throw new Error('Method not implemented.');
541
- }
542
- toString() {
543
- return this.body.map(definition => `\t${definition.toString()}`).join('\n');
544
- }
545
- toJson() {
546
- return {
547
- body: this.body.map(method => method.toJSON())
548
- };
549
- }
550
- };
551
- ClassBody = ClassBody_1 = __decorate([
552
- Deserializer('ClassBody'),
553
- __metadata("design:paramtypes", [Array, Array, Object])
554
- ], ClassBody);
555
- export { ClassBody };
482
+ get(stack, initializer) {
483
+ const name = this.getKeyName(stack);
484
+ if (!this.isStatic()) {
485
+ initializer.addInstanceInitializer(() => ({ isPrivate: this.isPrivate(), key: name, value: this.value?.get(stack) }));
486
+ return;
487
+ }
488
+ const value = this.value?.get(stack);
489
+ const attributes = { writable: true, configurable: true, enumerable: true, value };
490
+ if (this.isPrivate()) {
491
+ initializer.addStaticPrivateInitializer(name, attributes);
492
+ }
493
+ else {
494
+ initializer.addStaticInitializer(name, attributes);
495
+ }
496
+ }
497
+ toString() {
498
+ const decorators = this.decorators.map(decorator => decorator.toString()).join('\n');
499
+ const name = this.computed ? `[${this.key.toString()}]` : this.key.toString();
500
+ return `${decorators.length ? decorators + ' ' : ''}${this.static ? 'static ' : ''}${name}${this.value ? ` = ${this.value.toString()}` : ''};`;
501
+ }
502
+ toJson() {
503
+ return {
504
+ key: this.key.toJSON(),
505
+ value: this.value?.toJSON(),
506
+ decorators: this.decorators.map(decorator => decorator.toJSON()),
507
+ computed: this.computed,
508
+ static: this.static,
509
+ };
510
+ }
511
+ };
512
+ return PropertyDefinition = _classThis_5;
513
+ })();
514
+ export let AccessorProperty = (() => {
515
+ let _classDecorators_6 = [Deserializer('AccessorProperty')];
516
+ let _classDescriptor_6;
517
+ let _classExtraInitializers_6 = [];
518
+ let _classThis_6;
519
+ var AccessorProperty = class extends AbstractDefinition {
520
+ static {
521
+ __esDecorate(null, _classDescriptor_6 = { value: this }, _classDecorators_6, { kind: "class", name: this.name }, null, _classExtraInitializers_6);
522
+ AccessorProperty = _classThis_6 = _classDescriptor_6.value;
523
+ __runInitializers(_classThis_6, _classExtraInitializers_6);
524
+ }
525
+ static fromJSON(node, deserializer) {
526
+ return new AccessorProperty(deserializer(node.key), node.decorators.map(deserializer), node.computed, node.static, node.value ? deserializer(node.value) : void 0, node.range, node.loc);
527
+ }
528
+ static visit(node, visitNode) {
529
+ visitNode(node.key);
530
+ node.value && visitNode(node.value);
531
+ node.decorators.forEach(visitNode);
532
+ }
533
+ constructor(key, decorators, computed, isStatic, value, range, loc) {
534
+ super(key, decorators, computed, isStatic, value, range, loc);
535
+ }
536
+ get(stack, initializer) {
537
+ const name = this.getKeyName(stack);
538
+ const accessorAttributes = {
539
+ writable: false,
540
+ configurable: true,
541
+ enumerable: false,
542
+ set: function (value) {
543
+ this[PRIVATE_SYMBOL][name] = value;
544
+ },
545
+ get: function () {
546
+ return this[PRIVATE_SYMBOL][name];
547
+ },
548
+ };
549
+ if (!this.isStatic()) {
550
+ initializer.addInstanceInitializer(() => ({ isPrivate: true, key: name, value: this.value?.get(stack) }));
551
+ initializer.addInstanceMethod(name, accessorAttributes);
552
+ return;
553
+ }
554
+ const value = this.value?.get(stack);
555
+ const valueAttribute = { writable: true, configurable: true, enumerable: true, value };
556
+ initializer.addStaticInitializer(name, accessorAttributes);
557
+ initializer.addStaticPrivateInitializer(name, valueAttribute);
558
+ }
559
+ toString() {
560
+ const decorators = this.decorators.map(decorator => decorator.toString()).join('\n');
561
+ const name = this.computed ? `[${this.key.toString()}]` : this.key.toString();
562
+ return `${decorators.length ? decorators.concat(' ') : ''}${this.static ? 'static ' : ''}accessor ${name}${this.value ? ` = ${this.value.toString()}` : ''};`;
563
+ }
564
+ toJson() {
565
+ return {
566
+ key: this.key.toJSON(),
567
+ decorators: this.decorators.map(decorator => decorator.toJSON()),
568
+ computed: this.computed,
569
+ static: this.static,
570
+ value: this.value?.toJSON(),
571
+ };
572
+ }
573
+ };
574
+ return AccessorProperty = _classThis_6;
575
+ })();
576
+ export let ClassBody = (() => {
577
+ let _classDecorators_7 = [Deserializer('ClassBody')];
578
+ let _classDescriptor_7;
579
+ let _classExtraInitializers_7 = [];
580
+ let _classThis_7;
581
+ var ClassBody = class extends AbstractExpressionNode {
582
+ static {
583
+ __esDecorate(null, _classDescriptor_7 = { value: this }, _classDecorators_7, { kind: "class", name: this.name }, null, _classExtraInitializers_7);
584
+ ClassBody = _classThis_7 = _classDescriptor_7.value;
585
+ __runInitializers(_classThis_7, _classExtraInitializers_7);
586
+ }
587
+ body;
588
+ static fromJSON(node, deserializer) {
589
+ return new ClassBody(node.body.map(deserializer), node.range, node.loc);
590
+ }
591
+ static visit(node, visitNode) {
592
+ node.body.forEach(visitNode);
593
+ }
594
+ constructor(body, range, loc) {
595
+ super(range, loc);
596
+ this.body = body;
597
+ }
598
+ getBody() {
599
+ return this.body;
600
+ }
601
+ set(stack, value) {
602
+ throw new Error('Method not implemented.');
603
+ }
604
+ get(stack, initializer) {
605
+ this.body.forEach(definition => definition.get(stack, initializer));
606
+ }
607
+ dependency(computed) {
608
+ throw new Error('Method not implemented.');
609
+ }
610
+ dependencyPath(computed) {
611
+ throw new Error('Method not implemented.');
612
+ }
613
+ toString() {
614
+ return this.body.map(definition => `\t${definition.toString()}`).join('\n');
615
+ }
616
+ toJson() {
617
+ return {
618
+ body: this.body.map(method => method.toJSON())
619
+ };
620
+ }
621
+ };
622
+ return ClassBody = _classThis_7;
623
+ })();
556
624
  export class Class extends AbstractExpressionNode {
625
+ body;
626
+ decorators;
627
+ id;
628
+ superClass;
557
629
  constructor(body, decorators, id, superClass, range, loc) {
558
630
  super(range, loc);
559
631
  this.body = body;
@@ -594,22 +666,17 @@ export class Class extends AbstractExpressionNode {
594
666
  return ClassConstructor;
595
667
  }
596
668
  createClass(parentClass, className, initializer) {
597
- var _a, _b, _c, _d;
598
669
  const nameClassDeclaration = {
599
- [className]: (_d = class extends parentClass {
600
- constructor(...params) {
601
- const parameters = initializer.getSuperArguments(params);
602
- super(...parameters);
603
- this[_c] = {};
604
- initializer.initInstance(this);
605
- }
606
- },
607
- _a = Symbol.toStringTag,
608
- _b = PRIVATE_SYMBOL,
609
- _c = PRIVATE_SYMBOL,
610
- _d[_a] = className,
611
- _d[_b] = {},
612
- _d)
670
+ [className]: class extends parentClass {
671
+ static [Symbol.toStringTag] = className;
672
+ static [PRIVATE_SYMBOL] = {};
673
+ [PRIVATE_SYMBOL] = {};
674
+ constructor(...params) {
675
+ const parameters = initializer.getSuperArguments(params);
676
+ super(...parameters);
677
+ initializer.initInstance(this);
678
+ }
679
+ }
613
680
  };
614
681
  return nameClassDeclaration[className];
615
682
  }
@@ -639,53 +706,67 @@ export class Class extends AbstractExpressionNode {
639
706
  };
640
707
  }
641
708
  }
642
- let ClassDeclaration = ClassDeclaration_1 = class ClassDeclaration extends Class {
643
- static fromJSON(node, deserializer) {
644
- return new ClassDeclaration_1(deserializer(node.body), node.decorators.map(deserializer), deserializer(node.id), node.superClass && deserializer(node.superClass), node.range, node.loc);
645
- }
646
- static visit(node, visitNode) {
647
- visitNode(node.body);
648
- node.decorators.forEach(visitNode);
649
- visitNode(node.id);
650
- node.superClass && visitNode(node.superClass);
651
- }
652
- constructor(body, decorators, id, superClass, range, loc) {
653
- super(body, decorators, id, superClass, range, loc);
654
- }
655
- declareVariable(stack, propertyValue) {
656
- stack.declareVariable(this.id.getName(), propertyValue);
657
- }
658
- getDeclarationName() {
659
- return this.id.getDeclarationName();
660
- }
661
- get(stack) {
662
- const classConstructor = super.get(stack);
663
- this.id.declareVariable(stack, classConstructor);
664
- return classConstructor;
665
- }
666
- };
667
- ClassDeclaration = ClassDeclaration_1 = __decorate([
668
- Deserializer('ClassDeclaration'),
669
- __metadata("design:paramtypes", [ClassBody, Array, Identifier, Object, Array, Object])
670
- ], ClassDeclaration);
671
- export { ClassDeclaration };
672
- let ClassExpression = ClassExpression_1 = class ClassExpression extends Class {
673
- static fromJSON(node, deserializer) {
674
- return new ClassExpression_1(deserializer(node.body), node.decorators.map(deserializer), node.id && deserializer(node.id), node.superClass && deserializer(node.superClass), node.range, node.loc);
675
- }
676
- static visit(node, visitNode) {
677
- visitNode(node.body);
678
- node.decorators.forEach(visitNode);
679
- node.id && visitNode(node.id);
680
- node.superClass && visitNode(node.superClass);
681
- }
682
- constructor(body, decorators, id, superClass, range, loc) {
683
- super(body, decorators, id, superClass, range, loc);
684
- }
685
- };
686
- ClassExpression = ClassExpression_1 = __decorate([
687
- Deserializer('ClassExpression'),
688
- __metadata("design:paramtypes", [ClassBody, Array, Identifier, Object, Array, Object])
689
- ], ClassExpression);
690
- export { ClassExpression };
709
+ export let ClassDeclaration = (() => {
710
+ let _classDecorators_8 = [Deserializer('ClassDeclaration')];
711
+ let _classDescriptor_8;
712
+ let _classExtraInitializers_8 = [];
713
+ let _classThis_8;
714
+ var ClassDeclaration = class extends Class {
715
+ static {
716
+ __esDecorate(null, _classDescriptor_8 = { value: this }, _classDecorators_8, { kind: "class", name: this.name }, null, _classExtraInitializers_8);
717
+ ClassDeclaration = _classThis_8 = _classDescriptor_8.value;
718
+ __runInitializers(_classThis_8, _classExtraInitializers_8);
719
+ }
720
+ static fromJSON(node, deserializer) {
721
+ return new ClassDeclaration(deserializer(node.body), node.decorators.map(deserializer), deserializer(node.id), node.superClass && deserializer(node.superClass), node.range, node.loc);
722
+ }
723
+ static visit(node, visitNode) {
724
+ visitNode(node.body);
725
+ node.decorators.forEach(visitNode);
726
+ visitNode(node.id);
727
+ node.superClass && visitNode(node.superClass);
728
+ }
729
+ constructor(body, decorators, id, superClass, range, loc) {
730
+ super(body, decorators, id, superClass, range, loc);
731
+ }
732
+ declareVariable(stack, propertyValue) {
733
+ stack.declareVariable(this.id.getName(), propertyValue);
734
+ }
735
+ getDeclarationName() {
736
+ return this.id.getDeclarationName();
737
+ }
738
+ get(stack) {
739
+ const classConstructor = super.get(stack);
740
+ this.id.declareVariable(stack, classConstructor);
741
+ return classConstructor;
742
+ }
743
+ };
744
+ return ClassDeclaration = _classThis_8;
745
+ })();
746
+ export let ClassExpression = (() => {
747
+ let _classDecorators_9 = [Deserializer('ClassExpression')];
748
+ let _classDescriptor_9;
749
+ let _classExtraInitializers_9 = [];
750
+ let _classThis_9;
751
+ var ClassExpression = class extends Class {
752
+ static {
753
+ __esDecorate(null, _classDescriptor_9 = { value: this }, _classDecorators_9, { kind: "class", name: this.name }, null, _classExtraInitializers_9);
754
+ ClassExpression = _classThis_9 = _classDescriptor_9.value;
755
+ __runInitializers(_classThis_9, _classExtraInitializers_9);
756
+ }
757
+ static fromJSON(node, deserializer) {
758
+ return new ClassExpression(deserializer(node.body), node.decorators.map(deserializer), node.id && deserializer(node.id), node.superClass && deserializer(node.superClass), node.range, node.loc);
759
+ }
760
+ static visit(node, visitNode) {
761
+ visitNode(node.body);
762
+ node.decorators.forEach(visitNode);
763
+ node.id && visitNode(node.id);
764
+ node.superClass && visitNode(node.superClass);
765
+ }
766
+ constructor(body, decorators, id, superClass, range, loc) {
767
+ super(body, decorators, id, superClass, range, loc);
768
+ }
769
+ };
770
+ return ClassExpression = _classThis_9;
771
+ })();
691
772
  //# sourceMappingURL=class.js.map