greybel-interpreter 1.8.1 → 1.8.2

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.
package/dist/context.d.ts CHANGED
@@ -95,7 +95,7 @@ export declare class OperationContext {
95
95
  private static readonly lookupGlobalsType;
96
96
  private static readonly lookupLocalsType;
97
97
  constructor(options?: ContextOptions);
98
- isAllowedInStack(op: Operation): boolean;
98
+ isIgnoredInDebugging(op: Operation): boolean;
99
99
  step(op: Operation): Promise<CustomValue>;
100
100
  setLastActive(ctx: OperationContext): OperationContext;
101
101
  getLastActive(): OperationContext;
package/dist/context.js CHANGED
@@ -11,12 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OperationContext = exports.FunctionState = exports.LoopState = exports.ProcessState = exports.Debugger = exports.Scope = exports.ContextState = exports.ContextType = void 0;
13
13
  const handler_container_1 = require("./handler-container");
14
+ const noop_1 = require("./operations/noop");
14
15
  const operation_1 = require("./operations/operation");
15
16
  const base_1 = require("./types/base");
16
17
  const default_1 = require("./types/default");
17
18
  const map_1 = require("./types/map");
18
19
  const path_1 = require("./utils/path");
19
- const noop_1 = require("./operations/noop");
20
20
  var ContextType;
21
21
  (function (ContextType) {
22
22
  ContextType[ContextType["Api"] = 0] = "Api";
@@ -159,14 +159,15 @@ class OperationContext {
159
159
  this.globals = this.lookupGlobals();
160
160
  this.locals = this.lookupLocals() || this;
161
161
  }
162
- isAllowedInStack(op) {
163
- return !(op instanceof operation_1.OperationBlock) && !(op instanceof noop_1.Noop);
162
+ isIgnoredInDebugging(op) {
163
+ return op instanceof operation_1.OperationBlock || op instanceof noop_1.Noop;
164
164
  }
165
165
  step(op) {
166
166
  return __awaiter(this, void 0, void 0, function* () {
167
- if (this.isAllowedInStack(op)) {
168
- this.stackTrace.unshift(op);
167
+ if (this.isIgnoredInDebugging(op)) {
168
+ return op.handle(this);
169
169
  }
170
+ this.stackTrace.unshift(op);
170
171
  if (!this.injected) {
171
172
  this.target = op.target || this.target;
172
173
  this.setLastActive(this);
@@ -176,9 +177,7 @@ class OperationContext {
176
177
  }
177
178
  }
178
179
  const result = yield op.handle(this);
179
- if (this.isAllowedInStack(op)) {
180
- this.stackTrace.shift();
181
- }
180
+ this.stackTrace.shift();
182
181
  return result;
183
182
  });
184
183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",