greybel-interpreter 2.8.3 → 2.8.4

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.
@@ -32,15 +32,24 @@ class Call extends operation_1.Operation {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
33
  const exitObserver = ctx.processState.createExitObserver();
34
34
  const resolveResult = yield this.fnRef.getResult(ctx);
35
- exitObserver.close();
36
35
  if (exitObserver.occured()) {
36
+ exitObserver.close();
37
37
  return default_1.DefaultType.Void;
38
38
  }
39
39
  const valueRef = yield this.fnRef.handle(ctx, resolveResult, false);
40
40
  const fnArgs = [];
41
41
  for (let index = 0; index < this.args.length; index++) {
42
+ if (exitObserver.occured()) {
43
+ exitObserver.close();
44
+ return default_1.DefaultType.Void;
45
+ }
42
46
  fnArgs.push(yield this.args[index].handle(ctx));
43
47
  }
48
+ if (exitObserver.occured()) {
49
+ exitObserver.close();
50
+ return default_1.DefaultType.Void;
51
+ }
52
+ exitObserver.close();
44
53
  if (valueRef instanceof function_1.CustomFunction) {
45
54
  const func = valueRef;
46
55
  if (this.fnRef.path.isSuper() && ctx.functionState.context) {
@@ -67,14 +67,19 @@ class IfStatement extends operation_1.OperationBlock {
67
67
  }
68
68
  handle(ctx) {
69
69
  return __awaiter(this, void 0, void 0, function* () {
70
+ const exitObserver = ctx.processState.createExitObserver();
70
71
  for (let index = 0; index < this.clauses.length; index++) {
71
72
  const clause = this.clauses[index];
72
73
  const clauseResult = yield ctx.step(clause.condition);
74
+ if (exitObserver.occured()) {
75
+ break;
76
+ }
73
77
  if (clauseResult.toTruthy()) {
74
78
  yield clause.block.handle(ctx);
75
79
  break;
76
80
  }
77
81
  }
82
+ exitObserver.close();
78
83
  return default_1.DefaultType.Void;
79
84
  });
80
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",