greybel-interpreter 1.4.8 → 1.4.9

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.
@@ -148,6 +148,7 @@ class Resolve extends operation_1.default {
148
148
  if (index === lastIndex) {
149
149
  break;
150
150
  }
151
+ const previous = handle;
151
152
  if (handle !== default_1.default.Void) {
152
153
  if (handle instanceof with_intrinsics_1.CustomValueWithIntrinsics) {
153
154
  const customValueCtx = handle;
@@ -160,6 +161,9 @@ class Resolve extends operation_1.default {
160
161
  else {
161
162
  handle = ctx.get(traversedPath);
162
163
  }
164
+ if (handle instanceof function_1.default) {
165
+ handle = yield handle.run(previous || default_1.default.Void, [], ctx);
166
+ }
163
167
  traversedPath = new path_1.default();
164
168
  }
165
169
  else if (current instanceof SliceSegment) {
@@ -191,10 +195,7 @@ class Resolve extends operation_1.default {
191
195
  }
192
196
  const customValueCtx = result.handle;
193
197
  const child = customValueCtx.get(result.path);
194
- if (autoCall &&
195
- child instanceof function_1.default &&
196
- // support index bug in greyscript
197
- !(this.last instanceof IndexSegment)) {
198
+ if (autoCall && child instanceof function_1.default) {
198
199
  return child.run(customValueCtx, [], ctx);
199
200
  }
200
201
  return child;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",