greybel-interpreter 4.10.0 → 4.10.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 (2) hide show
  1. package/dist/vm.js +11 -2
  2. package/package.json +1 -1
package/dist/vm.js CHANGED
@@ -284,9 +284,12 @@ class VM {
284
284
  for (let i = 0; i < callInstruction.length; i++) {
285
285
  args[i] = this.popStack();
286
286
  }
287
- const propertyName = this.popStack();
287
+ const property = this.popStack();
288
288
  const context = this.popStack();
289
- const ret = context.getWithOrigin(propertyName, this.contextTypeIntrinsics);
289
+ if (!(context instanceof with_intrinsics_1.CustomValueWithIntrinsics)) {
290
+ throw new error_1.RuntimeError(`Path "${property.toString()}" not found in "${context.getCustomType()}" intrinsics.`, this);
291
+ }
292
+ const ret = context.getWithOrigin(property, this.contextTypeIntrinsics);
290
293
  const fn = ret.value;
291
294
  if (fn instanceof function_1.CustomFunction) {
292
295
  const newFrame = this.getFrame().fork({
@@ -310,6 +313,9 @@ class VM {
310
313
  }
311
314
  const property = this.popStack();
312
315
  const context = frame.locals.get(string_1.Super, this.contextTypeIntrinsics);
316
+ if (!(context instanceof with_intrinsics_1.CustomValueWithIntrinsics)) {
317
+ throw new error_1.RuntimeError(`Path "${property.toString()}" not found in "${context.getCustomType()}" intrinsics.`, this);
318
+ }
313
319
  const ret = context.getWithOrigin(property, this.contextTypeIntrinsics);
314
320
  const fn = ret.value;
315
321
  if (fn instanceof function_1.CustomFunction) {
@@ -471,6 +477,9 @@ class VM {
471
477
  const getPropertyInstruction = instruction;
472
478
  const property = this.popStack();
473
479
  const context = frame.locals.get(string_1.Super, this.contextTypeIntrinsics);
480
+ if (!(context instanceof with_intrinsics_1.CustomValueWithIntrinsics)) {
481
+ throw new error_1.RuntimeError(`Path "${property.toString()}" not found in "${context.getCustomType()}" intrinsics.`, this);
482
+ }
474
483
  const ret = context.getWithOrigin(property, this.contextTypeIntrinsics);
475
484
  if (ret.value instanceof function_1.CustomFunction && getPropertyInstruction.invoke) {
476
485
  const newFrame = this.getFrame().fork({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "4.10.0",
3
+ "version": "4.10.1",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",