greybel-interpreter 1.7.5 → 1.7.7

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.
@@ -7,7 +7,6 @@ interface RuntimeContext {
7
7
  export declare class RuntimeError extends Error {
8
8
  relatedItem: ASTBase | null;
9
9
  relatedTarget: string;
10
- stackTrace: Set<ASTBase>;
11
10
  source?: Error;
12
11
  constructor(message: string, context: RuntimeContext, source?: Error);
13
12
  private createTrace;
@@ -6,17 +6,22 @@ class RuntimeError extends Error {
6
6
  super(message);
7
7
  this.relatedItem = context.stackItem || null;
8
8
  this.relatedTarget = context.target;
9
- this.stackTrace = this.createTrace(context);
9
+ this.stack = this.createTrace(context);
10
10
  this.source = source;
11
11
  }
12
12
  createTrace(context) {
13
- const result = new Set();
13
+ var _a, _b;
14
+ const related = new Map();
14
15
  let item = context;
15
16
  while (item) {
16
- result.add(item.stackItem);
17
+ related.set(item.stackItem, item.target);
17
18
  item = item.previous;
18
19
  }
19
- return result;
20
+ const lines = [];
21
+ for (const [item, target] of related) {
22
+ lines.push(`${target} at ${(_a = item === null || item === void 0 ? void 0 : item.start.line) !== null && _a !== void 0 ? _a : 0}:${(_b = item === null || item === void 0 ? void 0 : item.start.character) !== null && _b !== void 0 ? _b : 0}`);
23
+ }
24
+ return lines.join('\n');
20
25
  }
21
26
  }
22
27
  exports.RuntimeError = RuntimeError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",