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