xmlui 0.8.6 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/{apiInterceptorWorker-fLBfPj2T.mjs → apiInterceptorWorker-230V_-Ds.mjs} +1 -1
  2. package/dist/{index-wd8FRzuM.mjs → index-DUwwx3L4.mjs} +5864 -6108
  3. package/dist/index.css +274 -301
  4. package/dist/language-server.mjs +25 -1
  5. package/dist/{lint-B18Ko6Sy.mjs → lint-gX2osbkz.mjs} +920 -1120
  6. package/dist/scripts/bin/build.js +2 -2
  7. package/dist/scripts/bin/start.js +3 -9
  8. package/dist/scripts/bin/vite-xmlui-plugin.js +2 -2
  9. package/dist/scripts/bin/viteConfig.js +89 -63
  10. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +1 -2
  11. package/dist/scripts/src/components/Accordion/Accordion.js +6 -16
  12. package/dist/scripts/src/components/App/AppNative.js +8 -0
  13. package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -5
  14. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +10 -4
  15. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +13 -19
  16. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
  17. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -3
  18. package/dist/scripts/src/components/Avatar/Avatar.js +2 -9
  19. package/dist/scripts/src/components/Badge/Badge.js +2 -8
  20. package/dist/scripts/src/components/Button/Button.js +28 -60
  21. package/dist/scripts/src/components/Card/Card.js +1 -6
  22. package/dist/scripts/src/components/Checkbox/Checkbox.js +4 -12
  23. package/dist/scripts/src/components/ComponentProvider.js +4 -0
  24. package/dist/scripts/src/components/DatePicker/DatePicker.js +3 -10
  25. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
  26. package/dist/scripts/src/components/Form/Form.js +12 -28
  27. package/dist/scripts/src/components/Form/FormNative.js +9 -0
  28. package/dist/scripts/src/components/FormItem/HelperText.js +1 -1
  29. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
  30. package/dist/scripts/src/components/Heading/HeadingNative.js +0 -1
  31. package/dist/scripts/src/components/HtmlTags/HtmlTags.js +4 -19
  32. package/dist/scripts/src/components/IconProvider.js +2 -2
  33. package/dist/scripts/src/components/Link/Link.js +2 -8
  34. package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
  35. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -3
  36. package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -3
  37. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +24 -12
  38. package/dist/scripts/src/components/NavLink/NavLink.js +4 -11
  39. package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -6
  40. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -8
  41. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -12
  42. package/dist/scripts/src/components/Select/Select.js +5 -13
  43. package/dist/scripts/src/components/Select/SelectNative.js +7 -3
  44. package/dist/scripts/src/components/Slider/Slider.js +2 -8
  45. package/dist/scripts/src/components/Spinner/Spinner.js +1 -6
  46. package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +22 -0
  47. package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +9 -0
  48. package/dist/scripts/src/components/Switch/Switch.js +6 -16
  49. package/dist/scripts/src/components/Table/Table.js +8 -17
  50. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +4 -12
  51. package/dist/scripts/src/components/Tabs/Tabs.js +3 -10
  52. package/dist/scripts/src/components/Text/Text.js +10 -24
  53. package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
  54. package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
  55. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -3
  56. package/dist/scripts/src/components-core/DevTools.js +5 -4
  57. package/dist/scripts/src/components-core/RestApiProxy.js +7 -3
  58. package/dist/scripts/src/components-core/action/APICall.js +2 -1
  59. package/dist/scripts/src/components-core/rendering/Container.js +15 -11
  60. package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -2
  61. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -2
  62. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
  63. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +11 -64
  64. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +196 -175
  65. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +173 -231
  66. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +129 -100
  67. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +170 -175
  68. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +48 -33
  69. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +164 -170
  70. package/dist/scripts/src/components-core/script-runner/statement-queue.js +5 -4
  71. package/dist/scripts/src/components-core/script-runner/visitors.js +124 -116
  72. package/dist/scripts/src/components-core/theming/themes/palette.js +1 -0
  73. package/dist/scripts/src/components-core/theming/themes/root.js +300 -154
  74. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +510 -510
  75. package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -1
  76. package/dist/scripts/src/components-core/theming/transformThemeVars.js +11 -11
  77. package/dist/scripts/src/components-core/utils/misc.js +13 -0
  78. package/dist/scripts/src/components-core/utils/statementUtils.js +56 -53
  79. package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
  80. package/dist/scripts/src/parsers/scripting-exp/Lexer.js +1092 -0
  81. package/dist/scripts/src/parsers/scripting-exp/Parser.js +2635 -0
  82. package/dist/scripts/src/parsers/scripting-exp/ParserError.js +47 -0
  83. package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +109 -0
  84. package/dist/scripts/src/parsers/scripting-exp/TokenType.js +2 -4
  85. package/dist/scripts/src/parsers/scripting-exp/code-behind-collect.js +101 -0
  86. package/dist/scripts/src/parsers/scripting-exp/modules.js +107 -0
  87. package/dist/scripts/src/parsers/{scripting → scripting-exp}/tree-visitor.js +103 -107
  88. package/dist/scripts/src/parsers/xmlui-parser/transform.js +12 -12
  89. package/dist/style.css +245 -286
  90. package/dist/xmlui-metadata.mjs +2741 -2211
  91. package/dist/xmlui-metadata.umd.js +2740 -2212
  92. package/dist/xmlui-parser.d.ts +320 -232
  93. package/dist/xmlui-parser.mjs +19 -19
  94. package/dist/xmlui-standalone.umd.js +6770 -7220
  95. package/dist/xmlui.d.ts +322 -230
  96. package/dist/xmlui.mjs +1 -1
  97. package/package.json +10 -6
  98. package/dist/_commonjsHelpers-CcAunmGO.mjs +0 -33
  99. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +0 -34
  100. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +0 -40
  101. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +0 -40
  102. package/dist/scripts/src/components-core/script-runner/syncProxy.js +0 -31
  103. package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -153
  104. package/dist/scripts/src/parsers/scripting/modules.js +0 -284
  105. /package/dist/scripts/src/abstractions/scripting/{LogicalThread.js → LogicalThreadExp.js} +0 -0
  106. /package/dist/scripts/src/abstractions/scripting/{TryScope.js → TryScopeExp.js} +0 -0
@@ -11,15 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.processStatementQueueAsync = processStatementQueueAsync;
13
13
  exports.processDeclarationsAsync = processDeclarationsAsync;
14
+ const ScriptingSourceTreeExp_1 = require("../../abstractions/scripting/ScriptingSourceTreeExp");
14
15
  const EngineError_1 = require("../EngineError");
15
16
  const reportEngineError_1 = require("../reportEngineError");
17
+ const statement_queue_1 = require("./statement-queue");
16
18
  const eval_tree_async_1 = require("./eval-tree-async");
17
19
  const process_statement_common_1 = require("./process-statement-common");
18
- const statement_queue_1 = require("./statement-queue");
20
+ const Parser_1 = require("../../parsers/scripting-exp/Parser");
19
21
  // --- Helper function to process the entire queue asynchronously
20
- function processStatementQueueAsync(statements, evalContext, thread, onStatementCompleted) {
22
+ function processStatementQueueAsync(statements, evalContext, thread) {
21
23
  return __awaiter(this, void 0, void 0, function* () {
22
- var _a, _b;
24
+ var _a, _b, _c, _d;
23
25
  if (!thread) {
24
26
  // --- Create the main thread for the queue
25
27
  thread = (0, process_statement_common_1.ensureMainThread)(evalContext);
@@ -28,7 +30,7 @@ function processStatementQueueAsync(statements, evalContext, thread, onStatement
28
30
  (0, process_statement_common_1.hoistFunctionDeclarations)(thread, statements);
29
31
  // --- Fill the queue with items
30
32
  const queue = new statement_queue_1.StatementQueue();
31
- queue.push((0, statement_queue_1.mapStatementsToQueueItems)(statements));
33
+ queue.push((0, statement_queue_1.mapStatementsToQueueItems)((0, process_statement_common_1.toStatementItems)(statements)));
32
34
  // --- Prepare queue diagnostics information
33
35
  const diagInfo = {
34
36
  processedStatements: 0,
@@ -50,7 +52,10 @@ function processStatementQueueAsync(statements, evalContext, thread, onStatement
50
52
  thread.breakLabelValue = queue.length > 0 ? queue.peek().label : -1;
51
53
  let outcome;
52
54
  try {
53
- outcome = yield processStatementAsync(queueItem.statement, evalContext, thread, onStatementCompleted);
55
+ // --- Sign that the statement is about to start
56
+ yield ((_b = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementStarted) === null || _b === void 0 ? void 0 : _b.call(evalContext, evalContext, queueItem.statement));
57
+ // --- Execute the statement
58
+ outcome = yield processStatementAsync(queueItem.statement, (_c = queueItem === null || queueItem === void 0 ? void 0 : queueItem.execInfo) !== null && _c !== void 0 ? _c : {}, evalContext, thread);
54
59
  }
55
60
  catch (err) {
56
61
  if (thread.tryBlocks && thread.tryBlocks.length > 0) {
@@ -70,7 +75,8 @@ function processStatementQueueAsync(statements, evalContext, thread, onStatement
70
75
  (0, reportEngineError_1.reportEngineError)(err);
71
76
  }
72
77
  else {
73
- (0, reportEngineError_1.reportEngineError)(new EngineError_1.StatementExecutionError(err, (_b = queueItem.statement) === null || _b === void 0 ? void 0 : _b.source), err);
78
+ // TODO: Provide source code information
79
+ (0, reportEngineError_1.reportEngineError)(new EngineError_1.StatementExecutionError(err /* queueItem!.statement?.source */), err);
74
80
  }
75
81
  }
76
82
  }
@@ -85,7 +91,8 @@ function processStatementQueueAsync(statements, evalContext, thread, onStatement
85
91
  diagInfo.clearToLabels++;
86
92
  }
87
93
  }
88
- yield (onStatementCompleted === null || onStatementCompleted === void 0 ? void 0 : onStatementCompleted(evalContext, queueItem.statement));
94
+ // --- Sign that the statement has been completed
95
+ yield ((_d = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementCompleted) === null || _d === void 0 ? void 0 : _d.call(evalContext, evalContext, queueItem.statement));
89
96
  // --- Provide diagnostics
90
97
  if (queue.length > diagInfo.maxQueueLength) {
91
98
  diagInfo.maxQueueLength = queue.length;
@@ -98,140 +105,108 @@ function processStatementQueueAsync(statements, evalContext, thread, onStatement
98
105
  }
99
106
  diagInfo.processedStatements++;
100
107
  }
108
+ // --- Done.
101
109
  return diagInfo;
102
110
  });
103
111
  }
104
112
  /**
105
113
  * Process the specified statement asynchronously
106
114
  * @param statement Statement to process
115
+ * @param execInfo Execution information
107
116
  * @param evalContext Evaluation context used for processing
108
117
  * @param thread Logical thread to use for statement processing
109
118
  * @param onStatementCompleted
110
119
  * @returns Items to put back into the queue of statements
111
120
  */
112
- function processStatementAsync(statement, evalContext, thread, onStatementCompleted) {
121
+ function processStatementAsync(statement, execInfo, evalContext, thread) {
113
122
  return __awaiter(this, void 0, void 0, function* () {
114
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
123
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
115
124
  // --- These items should be put in the statement queue after return
116
125
  let toUnshift = [];
117
126
  let clearToLabel;
118
127
  // --- Process the statement according to its type
119
128
  switch (statement.type) {
120
- case "ImportD":
121
- // --- Get module information
122
- const thisModule = statement.module;
123
- if (!thisModule) {
124
- throw new Error("Missing module");
125
- }
126
- const parentModule = (_a = statement.module) === null || _a === void 0 ? void 0 : _a.parent;
127
- if (!parentModule) {
128
- throw new Error("Missing parent module");
129
- }
130
- // --- At this point the imported module is set
131
- // if (!statement.module!.executed) {
132
- // // --- Run the module, it has not been executed yet
133
- // const childEvalContext = createEvalContext({
134
- // cancellationToken: evalContext.cancellationToken,
135
- // timeout: evalContext.timeout ?? 1000
136
- // });
137
- // statement.module!.executed = true;
138
- // executeScriptModule(statement.module!, childEvalContext);
139
- // }
140
- // --- Import the module's exported variables into the parent module
141
- const topVars = evalContext.mainThread.blocks[0].vars;
142
- const topConst = evalContext.mainThread.blocks[0].constVars;
143
- for (const modImports of Object.values(statement.imports)) {
144
- for (const key of Object.keys(modImports)) {
145
- if (key in topVars) {
146
- throw new Error(`Import ${key} already exists`);
147
- }
148
- topVars[key] = statement.module.exports.get(modImports[key]);
149
- topConst.add(key);
150
- }
151
- }
152
- break;
153
- case "FuncD":
129
+ case ScriptingSourceTreeExp_1.T_FUNCTION_DECLARATION:
154
130
  // --- Function declarations are already hoisted, nothing to do
155
131
  break;
156
- case "VarS":
132
+ case ScriptingSourceTreeExp_1.T_VAR_STATEMENT:
157
133
  if (thread !== evalContext.mainThread) {
158
134
  throw new Error("'var' declarations are not allowed within functions");
159
135
  }
160
136
  break;
161
- case "EmptyS":
137
+ case ScriptingSourceTreeExp_1.T_EMPTY_STATEMENT:
162
138
  // --- Nothing to do
163
139
  break;
164
- case "BlockS":
140
+ case ScriptingSourceTreeExp_1.T_BLOCK_STATEMENT:
165
141
  // --- No statement, nothing to process
166
- if (statement.statements.length === 0)
142
+ if (statement.stmts.length === 0)
167
143
  break;
168
144
  // --- Create a new block scope
169
- (_b = thread.blocks) !== null && _b !== void 0 ? _b : (thread.blocks = []);
145
+ (_a = thread.blocks) !== null && _a !== void 0 ? _a : (thread.blocks = []);
170
146
  thread.blocks.push({ vars: {} });
171
147
  // --- Hoist function declarations to the innermost block scope
172
- (0, process_statement_common_1.hoistFunctionDeclarations)(thread, statement.statements);
173
- // --- Prepare an empty statement that will only remove the block scope when the entire block is processed
174
- const closing = {
175
- type: "EmptyS",
176
- removeBlockScope: true,
177
- }; // --- We need the cast as we do not provide required props
178
- // --- Queue the block scope's body
179
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([...statement.statements, closing]);
148
+ (0, process_statement_common_1.hoistFunctionDeclarations)(thread, statement.stmts);
149
+ // --- Queue the block scope's body...
150
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
151
+ ...(0, process_statement_common_1.toStatementItems)(statement.stmts),
152
+ // --- ...and an empty statement to remove the block scope
153
+ (0, process_statement_common_1.closing)(),
154
+ ]);
180
155
  break;
181
- case "ExprS":
156
+ case ScriptingSourceTreeExp_1.T_EXPRESSION_STATEMENT:
182
157
  // --- Just evaluate it
183
- const statementValue = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread, onStatementCompleted);
158
+ const statementValue = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread);
184
159
  if (thread.blocks && thread.blocks.length !== 0) {
185
160
  thread.blocks[thread.blocks.length - 1].returnValue = statementValue;
186
161
  }
187
162
  break;
188
- case "ArrowS":
163
+ case ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION_STATEMENT:
189
164
  // --- Compile the arrow expression
190
- const arrowFuncValue = yield (0, eval_tree_async_1.executeArrowExpression)(statement.expression, evalContext, onStatementCompleted, thread, ...((_c = evalContext.eventArgs) !== null && _c !== void 0 ? _c : []));
165
+ const arrowFuncValue = yield (0, eval_tree_async_1.executeArrowExpression)(statement.expr, evalContext, thread, ...((_b = evalContext.eventArgs) !== null && _b !== void 0 ? _b : []));
191
166
  if (thread.blocks && thread.blocks.length !== 0) {
192
167
  thread.blocks[thread.blocks.length - 1].returnValue = arrowFuncValue;
193
168
  }
194
169
  break;
195
- case "LetS": {
170
+ case ScriptingSourceTreeExp_1.T_LET_STATEMENT: {
196
171
  // --- Create a new variable in the innermost scope
197
172
  const block = (0, process_statement_common_1.innermostBlockScope)(thread);
198
173
  if (!block) {
199
174
  throw new Error("Missing block scope");
200
175
  }
201
- yield processDeclarationsAsync(block, evalContext, thread, onStatementCompleted, statement.declarations);
176
+ yield processDeclarationsAsync(block, evalContext, thread, statement.decls);
202
177
  break;
203
178
  }
204
- case "ConstS": {
179
+ case ScriptingSourceTreeExp_1.T_CONST_STATEMENT: {
205
180
  // --- Create a new variable in the innermost scope
206
181
  const block = (0, process_statement_common_1.innermostBlockScope)(thread);
207
182
  if (!block) {
208
183
  throw new Error("Missing block scope");
209
184
  }
210
- yield processDeclarationsAsync(block, evalContext, thread, onStatementCompleted, statement.declarations, true);
185
+ yield processDeclarationsAsync(block, evalContext, thread, statement.decls, true);
211
186
  break;
212
187
  }
213
- case "IfS":
188
+ case ScriptingSourceTreeExp_1.T_IF_STATEMENT:
214
189
  // --- Evaluate the condition
215
- const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.condition, evalContext, thread, onStatementCompleted));
190
+ const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.cond, evalContext, thread));
216
191
  if (condition) {
217
- toUnshift = (0, statement_queue_1.mapToItem)(statement.thenBranch);
192
+ toUnshift = (0, statement_queue_1.mapToItem)(statement.thenB);
218
193
  }
219
- else if (statement.elseBranch) {
220
- toUnshift = (0, statement_queue_1.mapToItem)(statement.elseBranch);
194
+ else if (statement.elseB) {
195
+ toUnshift = (0, statement_queue_1.mapToItem)(statement.elseB);
221
196
  }
222
197
  break;
223
- case "RetS": {
198
+ case ScriptingSourceTreeExp_1.T_RETURN_STATEMENT: {
224
199
  // --- Check if return is valid here
225
200
  let blockScope = (0, process_statement_common_1.innermostBlockScope)(thread);
226
201
  if (blockScope === undefined) {
227
202
  throw new Error("Return requires a block scope");
228
203
  }
229
204
  // --- Store the return value
230
- thread.returnValue = statement.expression
231
- ? yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread, onStatementCompleted)
205
+ thread.returnValue = statement.expr
206
+ ? yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread)
232
207
  : undefined;
233
208
  // --- Check for try blocks
234
- if (((_d = thread.tryBlocks) !== null && _d !== void 0 ? _d : []).length > 0) {
209
+ if (((_c = thread.tryBlocks) !== null && _c !== void 0 ? _c : []).length > 0) {
235
210
  // --- Mark the loop's try scope to exit with "return"
236
211
  const returnTryScope = thread.tryBlocks[0];
237
212
  returnTryScope.exitType = "return";
@@ -249,11 +224,11 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
249
224
  }
250
225
  break;
251
226
  }
252
- case "WhileS": {
227
+ case ScriptingSourceTreeExp_1.T_WHILE_STATEMENT: {
253
228
  // --- Create or get the loop's scope (guard is falsy for the first execution)
254
- let loopScope = statement.guard ? (0, process_statement_common_1.innermostLoopScope)(thread) : (0, process_statement_common_1.createLoopScope)(thread);
229
+ let loopScope = execInfo.guard ? (0, process_statement_common_1.innermostLoopScope)(thread) : (0, process_statement_common_1.createLoopScope)(thread);
255
230
  // --- Evaluate the loop condition
256
- const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.condition, evalContext, thread, onStatementCompleted));
231
+ const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.cond, evalContext, thread));
257
232
  if (condition) {
258
233
  toUnshift = (0, process_statement_common_1.provideLoopBody)(loopScope, statement, thread.breakLabelValue);
259
234
  }
@@ -263,14 +238,14 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
263
238
  }
264
239
  break;
265
240
  }
266
- case "DoWS": {
267
- if (!statement.guard) {
241
+ case ScriptingSourceTreeExp_1.T_DO_WHILE_STATEMENT: {
242
+ if (!execInfo.guard) {
268
243
  // --- First loop execution (do-while is a post-test loop)
269
244
  toUnshift = (0, process_statement_common_1.provideLoopBody)((0, process_statement_common_1.createLoopScope)(thread), statement, thread.breakLabelValue);
270
245
  break;
271
246
  }
272
247
  // --- Evaluate the loop condition
273
- const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.condition, evalContext, thread, onStatementCompleted));
248
+ const condition = !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.cond, evalContext, thread));
274
249
  if (condition) {
275
250
  toUnshift = (0, process_statement_common_1.provideLoopBody)((0, process_statement_common_1.innermostLoopScope)(thread), statement, thread.breakLabelValue);
276
251
  }
@@ -280,7 +255,7 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
280
255
  }
281
256
  break;
282
257
  }
283
- case "ContS": {
258
+ case ScriptingSourceTreeExp_1.T_CONTINUE_STATEMENT: {
284
259
  // --- Search for the innermost non-switch loop scope, release the switch scopes
285
260
  if (!thread.loops || thread.loops.length === 0) {
286
261
  throw new Error("Missing loop scope");
@@ -296,7 +271,8 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
296
271
  if (!loopScope) {
297
272
  throw new Error("Missing loop scope");
298
273
  }
299
- if (loopScope.tryBlockDepth >= 0 && loopScope.tryBlockDepth < ((_e = thread.tryBlocks) !== null && _e !== void 0 ? _e : []).length) {
274
+ if (loopScope.tryBlockDepth >= 0 &&
275
+ loopScope.tryBlockDepth < ((_d = thread.tryBlocks) !== null && _d !== void 0 ? _d : []).length) {
300
276
  // --- Mark the loop's try scope to exit with "continue"
301
277
  for (let i = loopScope.tryBlockDepth; i < thread.tryBlocks.length; i++) {
302
278
  thread.tryBlocks[loopScope.tryBlockDepth].exitType = "continue";
@@ -311,7 +287,7 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
311
287
  }
312
288
  break;
313
289
  }
314
- case "BrkS": {
290
+ case ScriptingSourceTreeExp_1.T_BREAK_STATEMENT: {
315
291
  const loopScope = (0, process_statement_common_1.innermostLoopScope)(thread);
316
292
  if (loopScope === undefined) {
317
293
  throw new Error("Missing loop scope");
@@ -322,7 +298,8 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
322
298
  break;
323
299
  }
324
300
  // --- Break is in a loop construct
325
- if (loopScope.tryBlockDepth >= 0 && loopScope.tryBlockDepth < ((_f = thread.tryBlocks) !== null && _f !== void 0 ? _f : []).length) {
301
+ if (loopScope.tryBlockDepth >= 0 &&
302
+ loopScope.tryBlockDepth < ((_e = thread.tryBlocks) !== null && _e !== void 0 ? _e : []).length) {
326
303
  // --- Mark the loop's try scope to exit with "break"
327
304
  for (let i = loopScope.tryBlockDepth; i < thread.tryBlocks.length; i++) {
328
305
  thread.tryBlocks[loopScope.tryBlockDepth].exitType = "break";
@@ -337,19 +314,19 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
337
314
  }
338
315
  break;
339
316
  }
340
- case "ForS":
341
- if (!statement.guard) {
317
+ case ScriptingSourceTreeExp_1.T_FOR_STATEMENT:
318
+ if (!execInfo.guard) {
342
319
  // --- Init the loop with a new scope
343
320
  (0, process_statement_common_1.createLoopScope)(thread, 1);
344
321
  // --- Create a new block for the loop variables
345
- (_g = thread.blocks) !== null && _g !== void 0 ? _g : (thread.blocks = []);
322
+ (_f = thread.blocks) !== null && _f !== void 0 ? _f : (thread.blocks = []);
346
323
  thread.blocks.push({
347
324
  vars: {},
348
325
  });
349
- const guardStatement = Object.assign(Object.assign({}, statement), { guard: true });
326
+ const guardStatement = (0, process_statement_common_1.guard)(statement);
350
327
  if (statement.init) {
351
328
  // --- Unshift the initialization part and the guarded for-loop
352
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([statement.init, guardStatement]);
329
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([{ statement: statement.init }, guardStatement]);
353
330
  }
354
331
  else {
355
332
  // --- No init, unshift only the guard statement
@@ -358,22 +335,31 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
358
335
  }
359
336
  else {
360
337
  // --- Initialization already done. Evaluate the condition
361
- if (!statement.condition ||
362
- !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.condition, evalContext, thread, onStatementCompleted))) {
338
+ if (!statement.cond || !!(yield (0, eval_tree_async_1.evalBindingAsync)(statement.cond, evalContext, thread))) {
363
339
  // --- Stay in the loop, inject the body, the update expression, and the loop guard
364
340
  const loopScope = (0, process_statement_common_1.innermostLoopScope)(thread);
365
- if (statement.update) {
341
+ if (statement.upd) {
366
342
  const updateStmt = {
367
- type: "ExprS",
368
- expression: statement.update,
343
+ statement: {
344
+ type: ScriptingSourceTreeExp_1.T_EXPRESSION_STATEMENT,
345
+ nodeId: (0, Parser_1.createXmlUiTreeNodeId)(),
346
+ expr: statement.upd,
347
+ },
369
348
  };
370
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([statement.body, updateStmt, Object.assign({}, statement)]);
349
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
350
+ { statement: statement.body },
351
+ updateStmt,
352
+ { statement, execInfo },
353
+ ]);
371
354
  }
372
355
  else {
373
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([statement.body, Object.assign({}, statement)]);
356
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
357
+ { statement: statement.body },
358
+ { statement, execInfo },
359
+ ]);
374
360
  }
375
361
  // --- The next queue label is for "break"
376
- loopScope.breakLabel = (_h = thread.breakLabelValue) !== null && _h !== void 0 ? _h : -1;
362
+ loopScope.breakLabel = (_g = thread.breakLabelValue) !== null && _g !== void 0 ? _g : -1;
377
363
  // --- The guard action's label is for "continue"
378
364
  loopScope.continueLabel = toUnshift[1].label;
379
365
  }
@@ -383,10 +369,10 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
383
369
  }
384
370
  }
385
371
  break;
386
- case "ForInS":
387
- if (!statement.guard) {
372
+ case ScriptingSourceTreeExp_1.T_FOR_IN_STATEMENT:
373
+ if (!execInfo.guard) {
388
374
  // --- Get the object keys
389
- const keyedObject = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread);
375
+ const keyedObject = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread);
390
376
  if (keyedObject == undefined) {
391
377
  // --- Nothing to do, no object to traverse
392
378
  break;
@@ -394,32 +380,32 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
394
380
  // --- Init the loop with a new scope
395
381
  (0, process_statement_common_1.createLoopScope)(thread, 1);
396
382
  // --- Create a new block for the loop variables
397
- (_j = thread.blocks) !== null && _j !== void 0 ? _j : (thread.blocks = []);
383
+ (_h = thread.blocks) !== null && _h !== void 0 ? _h : (thread.blocks = []);
398
384
  thread.blocks.push({ vars: {} });
399
- statement.keys = Object.keys(keyedObject);
400
- statement.keyIndex = 0;
401
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([Object.assign(Object.assign({}, statement), { guard: true })]);
385
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
386
+ { statement, execInfo: { guard: true, keys: Object.keys(keyedObject), keyIndex: 0 } },
387
+ ]);
402
388
  }
403
389
  else {
404
390
  // --- Just for the sake of extra safety
405
- if (statement.keyIndex === undefined || statement.keys === undefined) {
391
+ if (execInfo.keyIndex === undefined || execInfo.keys === undefined) {
406
392
  throw new Error("Keys information expected in for..in loop");
407
393
  }
408
394
  // --- Any key left?
409
- if (statement.keyIndex < statement.keys.length) {
395
+ if (execInfo.keyIndex < execInfo.keys.length) {
410
396
  // --- Set the binding variable to the next key
411
- const propValue = statement.keys[statement.keyIndex++];
412
- switch (statement.varBinding) {
397
+ const propValue = execInfo.keys[execInfo.keyIndex++];
398
+ switch (statement.varB) {
413
399
  case "none": {
414
400
  const assigmentExpr = {
415
- type: "AsgnE",
401
+ type: ScriptingSourceTreeExp_1.T_ASSIGNMENT_EXPRESSION,
416
402
  leftValue: {
417
- type: "IdE",
418
- name: statement.id,
403
+ type: ScriptingSourceTreeExp_1.T_IDENTIFIER,
404
+ name: statement.id.name,
419
405
  },
420
- operator: "=",
421
- operand: {
422
- type: "LitE",
406
+ op: "=",
407
+ expr: {
408
+ type: ScriptingSourceTreeExp_1.T_LITERAL,
423
409
  value: propValue,
424
410
  },
425
411
  };
@@ -434,19 +420,22 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
434
420
  if (!block) {
435
421
  throw new Error("Missing block scope");
436
422
  }
437
- block.vars[statement.id] = propValue;
438
- if (statement.varBinding === "const") {
439
- (_k = block.constVars) !== null && _k !== void 0 ? _k : (block.constVars = new Set());
440
- block.constVars.add(statement.id);
423
+ block.vars[statement.id.name] = propValue;
424
+ if (statement.varB === "const") {
425
+ (_j = block.constVars) !== null && _j !== void 0 ? _j : (block.constVars = new Set());
426
+ block.constVars.add(statement.id.name);
441
427
  }
442
428
  }
443
429
  break;
444
430
  }
445
431
  // --- Inject the loop body
446
432
  const loopScope = (0, process_statement_common_1.innermostLoopScope)(thread);
447
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([statement.body, Object.assign({}, statement)]);
433
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
434
+ { statement: statement.body },
435
+ { statement, execInfo },
436
+ ]);
448
437
  // --- The next queue label is for "break"
449
- loopScope.breakLabel = (_l = thread.breakLabelValue) !== null && _l !== void 0 ? _l : -1;
438
+ loopScope.breakLabel = (_k = thread.breakLabelValue) !== null && _k !== void 0 ? _k : -1;
450
439
  // --- The guard action's label is for "continue"
451
440
  loopScope.continueLabel = toUnshift[1].label;
452
441
  }
@@ -456,10 +445,10 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
456
445
  }
457
446
  }
458
447
  break;
459
- case "ForOfS":
460
- if (!statement.guard) {
448
+ case ScriptingSourceTreeExp_1.T_FOR_OF_STATEMENT:
449
+ if (!execInfo.guard) {
461
450
  // --- Get the object keys
462
- const iteratorObject = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread);
451
+ const iteratorObject = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread);
463
452
  if (iteratorObject == null || typeof iteratorObject[Symbol.iterator] !== "function") {
464
453
  // --- The object is not an iterator
465
454
  throw new Error("Object in for..of is not iterable");
@@ -467,18 +456,19 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
467
456
  // --- Init the loop with a new scope
468
457
  (0, process_statement_common_1.createLoopScope)(thread, 1);
469
458
  // --- Create a new block for the loop variables
470
- (_m = thread.blocks) !== null && _m !== void 0 ? _m : (thread.blocks = []);
459
+ (_l = thread.blocks) !== null && _l !== void 0 ? _l : (thread.blocks = []);
471
460
  thread.blocks.push({ vars: {} });
472
- statement.iterator = iteratorObject[Symbol.iterator]();
473
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([Object.assign(Object.assign({}, statement), { guard: true })]);
461
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
462
+ { statement, execInfo: { guard: true, iterator: iteratorObject[Symbol.iterator]() } },
463
+ ]);
474
464
  }
475
465
  else {
476
466
  // --- Just for the sake of extra safety
477
- if (statement.iterator === undefined) {
467
+ if (execInfo.iterator === undefined) {
478
468
  throw new Error("Iterator expected in for..of loop");
479
469
  }
480
470
  // --- Any iteration left?
481
- const nextIteration = statement.iterator.next();
471
+ const nextIteration = execInfo.iterator.next();
482
472
  if (nextIteration.done) {
483
473
  // --- The for..of loop is complete. Remove the loop's scope from the evaluation context
484
474
  (0, process_statement_common_1.releaseLoopScope)(thread);
@@ -486,17 +476,17 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
486
476
  }
487
477
  // --- Set the binding variable to the next key
488
478
  const propValue = nextIteration.value;
489
- switch (statement.varBinding) {
479
+ switch (statement.varB) {
490
480
  case "none": {
491
481
  const assigmentExpr = {
492
- type: "AsgnE",
482
+ type: ScriptingSourceTreeExp_1.T_ASSIGNMENT_EXPRESSION,
493
483
  leftValue: {
494
- type: "IdE",
495
- name: statement.id,
484
+ type: ScriptingSourceTreeExp_1.T_IDENTIFIER,
485
+ name: statement.id.name,
496
486
  },
497
- operator: "=",
498
- operand: {
499
- type: "LitE",
487
+ op: "=",
488
+ expr: {
489
+ type: ScriptingSourceTreeExp_1.T_LITERAL,
500
490
  value: propValue,
501
491
  },
502
492
  };
@@ -511,28 +501,31 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
511
501
  if (!block) {
512
502
  throw new Error("Missing block scope");
513
503
  }
514
- block.vars[statement.id] = propValue;
515
- if (statement.varBinding === "const") {
516
- (_o = block.constVars) !== null && _o !== void 0 ? _o : (block.constVars = new Set());
517
- block.constVars.add(statement.id);
504
+ block.vars[statement.id.name] = propValue;
505
+ if (statement.varB === "const") {
506
+ (_m = block.constVars) !== null && _m !== void 0 ? _m : (block.constVars = new Set());
507
+ block.constVars.add(statement.id.name);
518
508
  }
519
509
  }
520
510
  break;
521
511
  }
522
512
  // --- Inject the loop body
523
513
  const loopScope = (0, process_statement_common_1.innermostLoopScope)(thread);
524
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([statement.body, Object.assign({}, statement)]);
514
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
515
+ { statement: statement.body },
516
+ { statement, execInfo },
517
+ ]);
525
518
  // --- The next queue label is for "break"
526
- loopScope.breakLabel = (_p = thread.breakLabelValue) !== null && _p !== void 0 ? _p : -1;
519
+ loopScope.breakLabel = (_o = thread.breakLabelValue) !== null && _o !== void 0 ? _o : -1;
527
520
  // --- The guard action's label is for "continue"
528
521
  loopScope.continueLabel = toUnshift[1].label;
529
522
  }
530
523
  break;
531
- case "ThrowS": {
532
- throw new EngineError_1.ThrowStatementError(yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread, onStatementCompleted));
524
+ case ScriptingSourceTreeExp_1.T_THROW_STATEMENT: {
525
+ throw new EngineError_1.ThrowStatementError(yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread));
533
526
  }
534
- case "TryS": {
535
- if (!statement.guard) {
527
+ case ScriptingSourceTreeExp_1.T_TRY_STATEMENT: {
528
+ if (!execInfo.guard) {
536
529
  // --- Execute the try block
537
530
  toUnshift = (0, process_statement_common_1.provideTryBody)(thread, (0, process_statement_common_1.createTryScope)(thread, statement));
538
531
  break;
@@ -547,10 +540,10 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
547
540
  // --- Remove the "try" block's scope
548
541
  thread.blocks.pop();
549
542
  // --- Go on with catch or finally
550
- if (statement.catchBlock) {
551
- if (tryScope.statement.catchVariable) {
543
+ if (statement.catchB) {
544
+ if (tryScope.statement.catchV) {
552
545
  const block = (0, process_statement_common_1.innermostBlockScope)(thread);
553
- block.vars[tryScope.statement.catchVariable] =
546
+ block.vars[tryScope.statement.catchV.name] =
554
547
  tryScope.errorToThrow instanceof EngineError_1.ThrowStatementError
555
548
  ? tryScope.errorToThrow.errorObject
556
549
  : tryScope.errorToThrow;
@@ -559,7 +552,7 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
559
552
  tryScope.processingPhase = "catch";
560
553
  toUnshift = (0, process_statement_common_1.provideCatchBody)(thread, tryScope);
561
554
  }
562
- else if (tryScope.statement.finallyBlock) {
555
+ else if (tryScope.statement.finallyB) {
563
556
  // --- No catch, move on finally
564
557
  tryScope.processingPhase = "finally";
565
558
  toUnshift = (0, process_statement_common_1.provideFinallyBody)(thread, tryScope);
@@ -584,14 +577,14 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
584
577
  case "try":
585
578
  // --- We completed the try block successfully
586
579
  tryScope.processingPhase = "finally";
587
- if (statement.finallyBlock) {
580
+ if (statement.finallyB) {
588
581
  toUnshift = (0, process_statement_common_1.provideFinallyBody)(thread, tryScope);
589
582
  }
590
583
  break;
591
584
  case "catch":
592
585
  // --- We completed the catch block successfully, remove the handled error
593
586
  tryScope.processingPhase = "finally";
594
- if (statement.finallyBlock) {
587
+ if (statement.finallyB) {
595
588
  toUnshift = (0, process_statement_common_1.provideFinallyBody)(thread, tryScope);
596
589
  }
597
590
  break;
@@ -634,9 +627,9 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
634
627
  }
635
628
  break;
636
629
  }
637
- case "SwitchS": {
630
+ case ScriptingSourceTreeExp_1.T_SWITCH_STATEMENT: {
638
631
  // --- Create or get the loop's scope (guard is falsy for the first execution)
639
- if (statement.guard) {
632
+ if (execInfo.guard) {
640
633
  // --- Complete the switch
641
634
  (0, process_statement_common_1.releaseLoopScope)(thread);
642
635
  }
@@ -645,18 +638,18 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
645
638
  loopScope.isSwitch = true;
646
639
  thread.blocks.push({ vars: {} });
647
640
  // --- Evaluate the switch value
648
- const switchValue = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expression, evalContext, thread);
641
+ const switchValue = yield (0, eval_tree_async_1.evalBindingAsync)(statement.expr, evalContext, thread);
649
642
  // --- Find the matching label
650
643
  let matchingIndex = -1;
651
644
  for (let i = 0; i < statement.cases.length; i++) {
652
645
  const currentCase = statement.cases[i];
653
646
  // --- Check for default case
654
- if (currentCase.caseExpression === undefined) {
647
+ if (currentCase.caseE === undefined) {
655
648
  matchingIndex = i;
656
649
  break;
657
650
  }
658
651
  // --- Check for matching case
659
- const caseValue = yield (0, eval_tree_async_1.evalBindingAsync)(currentCase.caseExpression, evalContext, thread);
652
+ const caseValue = yield (0, eval_tree_async_1.evalBindingAsync)(currentCase.caseE, evalContext, thread);
660
653
  if (caseValue === switchValue) {
661
654
  matchingIndex = i;
662
655
  break;
@@ -666,19 +659,21 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
666
659
  const statementFlow = [];
667
660
  if (matchingIndex >= 0) {
668
661
  for (let i = matchingIndex; i < statement.cases.length; i++) {
669
- statementFlow.push(...statement.cases[i].statements);
662
+ statementFlow.push(...statement.cases[i].stmts);
670
663
  }
671
664
  }
672
665
  // --- Queue the statement flow and the guard
673
- const guardStatement = Object.assign(Object.assign({}, statement), { guard: true });
674
- toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([...statementFlow, guardStatement]);
666
+ toUnshift = (0, statement_queue_1.mapStatementsToQueueItems)([
667
+ ...(0, process_statement_common_1.toStatementItems)(statementFlow),
668
+ (0, process_statement_common_1.guard)(statement),
669
+ ]);
675
670
  loopScope.breakLabel = toUnshift[toUnshift.length - 1].label;
676
671
  }
677
672
  break;
678
673
  }
679
674
  }
680
675
  // --- The statement may remove the innermost scope
681
- if (statement.removeBlockScope) {
676
+ if (execInfo.removeBlockScope) {
682
677
  if (thread.blocks && thread.blocks.length > 0) {
683
678
  thread.blocks.pop();
684
679
  }
@@ -688,16 +683,16 @@ function processStatementAsync(statement, evalContext, thread, onStatementComple
688
683
  });
689
684
  }
690
685
  // --- Process a variable declaration
691
- function processDeclarationsAsync(block_1, evalContext_1, thread_1, onStatementCompleted_1, declarations_1) {
692
- return __awaiter(this, arguments, void 0, function* (block, evalContext, thread, onStatementCompleted, declarations, addConst = false, useValue = false, baseValue = undefined) {
686
+ function processDeclarationsAsync(block_1, evalContext_1, thread_1, declarations_1) {
687
+ return __awaiter(this, arguments, void 0, function* (block, evalContext, thread, declarations, addConst = false, useValue = false, baseValue = undefined) {
693
688
  for (let i = 0; i < declarations.length; i++) {
694
689
  let value;
695
690
  const decl = declarations[i];
696
691
  if (useValue) {
697
692
  value = baseValue;
698
693
  }
699
- else if (decl.expression) {
700
- value = yield (0, eval_tree_async_1.evalBindingAsync)(decl.expression, evalContext, thread, onStatementCompleted);
694
+ else if (decl.expr) {
695
+ value = yield (0, eval_tree_async_1.evalBindingAsync)(decl.expr, evalContext, thread);
701
696
  }
702
697
  visitDeclaration(block, decl, value, addConst);
703
698
  }
@@ -707,11 +702,11 @@ function processDeclarationsAsync(block_1, evalContext_1, thread_1, onStatementC
707
702
  if (decl.id) {
708
703
  visitIdDeclaration(block, decl.id, baseValue, addConst);
709
704
  }
710
- else if (decl.arrayDestruct) {
711
- visitArrayDestruct(block, decl.arrayDestruct, baseValue, addConst);
705
+ else if (decl.aDestr) {
706
+ visitArrayDestruct(block, decl.aDestr, baseValue, addConst);
712
707
  }
713
- else if (decl.objectDestruct) {
714
- visitObjectDestruct(block, decl.objectDestruct, baseValue, addConst);
708
+ else if (decl.oDestr) {
709
+ visitObjectDestruct(block, decl.oDestr, baseValue, addConst);
715
710
  }
716
711
  else {
717
712
  throw new Error("Unknown declaration specifier");
@@ -737,11 +732,11 @@ function processDeclarationsAsync(block_1, evalContext_1, thread_1, onStatementC
737
732
  if (arrDecl.id) {
738
733
  visitIdDeclaration(block, arrDecl.id, value, addConst);
739
734
  }
740
- else if (arrDecl.arrayDestruct) {
741
- visitArrayDestruct(block, arrDecl.arrayDestruct, value, addConst);
735
+ else if (arrDecl.aDestr) {
736
+ visitArrayDestruct(block, arrDecl.aDestr, value, addConst);
742
737
  }
743
- else if (arrDecl.objectDestruct) {
744
- visitObjectDestruct(block, arrDecl.objectDestruct, value, addConst);
738
+ else if (arrDecl.oDestr) {
739
+ visitObjectDestruct(block, arrDecl.oDestr, value, addConst);
745
740
  }
746
741
  }
747
742
  }
@@ -751,11 +746,11 @@ function processDeclarationsAsync(block_1, evalContext_1, thread_1, onStatementC
751
746
  for (let i = 0; i < objectD.length; i++) {
752
747
  const objDecl = objectD[i];
753
748
  const value = baseValue === null || baseValue === void 0 ? void 0 : baseValue[objDecl.id];
754
- if (objDecl.arrayDestruct) {
755
- visitArrayDestruct(block, objDecl.arrayDestruct, value, addConst);
749
+ if (objDecl.aDestr) {
750
+ visitArrayDestruct(block, objDecl.aDestr, value, addConst);
756
751
  }
757
- else if (objDecl.objectDestruct) {
758
- visitObjectDestruct(block, objDecl.objectDestruct, value, addConst);
752
+ else if (objDecl.oDestr) {
753
+ visitObjectDestruct(block, objDecl.oDestr, value, addConst);
759
754
  }
760
755
  else {
761
756
  visitIdDeclaration(block, (_a = objDecl.alias) !== null && _a !== void 0 ? _a : objDecl.id, value, addConst);