greybel-interpreter 1.2.8 → 1.3.0
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.js
CHANGED
|
@@ -49,7 +49,6 @@ var default_1 = __importDefault(require("./types/default"));
|
|
|
49
49
|
var generics_1 = require("./types/generics");
|
|
50
50
|
var map_1 = __importDefault(require("./types/map"));
|
|
51
51
|
var path_1 = __importDefault(require("./utils/path"));
|
|
52
|
-
var asap_1 = __importDefault(require("asap"));
|
|
53
52
|
var ContextType;
|
|
54
53
|
(function (ContextType) {
|
|
55
54
|
ContextType[ContextType["Api"] = 0] = "Api";
|
|
@@ -145,7 +144,7 @@ var Debugger = /** @class */ (function () {
|
|
|
145
144
|
resolve();
|
|
146
145
|
}
|
|
147
146
|
else {
|
|
148
|
-
(
|
|
147
|
+
setTimeout(check);
|
|
149
148
|
}
|
|
150
149
|
};
|
|
151
150
|
check();
|
|
@@ -262,7 +261,7 @@ var OperationContext = /** @class */ (function () {
|
|
|
262
261
|
resolve(_this);
|
|
263
262
|
}
|
|
264
263
|
else {
|
|
265
|
-
(
|
|
264
|
+
setTimeout(check);
|
|
266
265
|
}
|
|
267
266
|
};
|
|
268
267
|
check();
|
|
@@ -230,7 +230,7 @@ var Resolve = /** @class */ (function (_super) {
|
|
|
230
230
|
handle = ctx.get(traversedPath);
|
|
231
231
|
}
|
|
232
232
|
if (!(handle instanceof function_1.default)) return [3 /*break*/, 5];
|
|
233
|
-
return [4 /*yield*/, handle.run(previous || default_1.default.Void, [])];
|
|
233
|
+
return [4 /*yield*/, handle.run(previous || default_1.default.Void, [], ctx)];
|
|
234
234
|
case 4:
|
|
235
235
|
handle = _a.sent();
|
|
236
236
|
_a.label = 5;
|
|
@@ -302,7 +302,7 @@ var Resolve = /** @class */ (function (_super) {
|
|
|
302
302
|
if (result.handle !== default_1.default.Void) {
|
|
303
303
|
if (result.path.count() === 0) {
|
|
304
304
|
if (autoCall && result.handle instanceof function_1.default) {
|
|
305
|
-
return [2 /*return*/, result.handle.run(default_1.default.Void, [])];
|
|
305
|
+
return [2 /*return*/, result.handle.run(default_1.default.Void, [], ctx)];
|
|
306
306
|
}
|
|
307
307
|
return [2 /*return*/, result.handle];
|
|
308
308
|
}
|
|
@@ -312,13 +312,13 @@ var Resolve = /** @class */ (function (_super) {
|
|
|
312
312
|
child instanceof function_1.default &&
|
|
313
313
|
// support index bug in greyscript
|
|
314
314
|
!(this.last instanceof IndexSegment)) {
|
|
315
|
-
return [2 /*return*/, child.run(customValueCtx, [])];
|
|
315
|
+
return [2 /*return*/, child.run(customValueCtx, [], ctx)];
|
|
316
316
|
}
|
|
317
317
|
return [2 /*return*/, child];
|
|
318
318
|
}
|
|
319
319
|
handle = ctx.get(result.path);
|
|
320
320
|
if (autoCall && handle instanceof function_1.default) {
|
|
321
|
-
return [2 /*return*/, handle.run(default_1.default.Void, [])];
|
|
321
|
+
return [2 /*return*/, handle.run(default_1.default.Void, [], ctx)];
|
|
322
322
|
}
|
|
323
323
|
return [2 /*return*/, handle];
|
|
324
324
|
}
|
package/dist/types/function.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export default class CustomFunction extends CustomValue {
|
|
|
28
28
|
toInt(): number;
|
|
29
29
|
toString(): string;
|
|
30
30
|
toTruthy(): boolean;
|
|
31
|
-
run(self: CustomValue, args: Array<CustomValue>, callContext
|
|
31
|
+
run(self: CustomValue, args: Array<CustomValue>, callContext: OperationContext): Promise<CustomValue>;
|
|
32
32
|
}
|