greybel-interpreter 0.4.1 → 0.4.5
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 +16 -10
- package/dist/interpreter.js +5 -5
- package/package.json +1 -1
package/dist/context.js
CHANGED
|
@@ -180,7 +180,7 @@ var Debugger = /** @class */ (function () {
|
|
|
180
180
|
return me;
|
|
181
181
|
};
|
|
182
182
|
Debugger.prototype.getBreakpoint = function (operationContext) {
|
|
183
|
-
return
|
|
183
|
+
return this.breakpoint;
|
|
184
184
|
};
|
|
185
185
|
Debugger.prototype.next = function () {
|
|
186
186
|
var me = this;
|
|
@@ -202,10 +202,10 @@ var Debugger = /** @class */ (function () {
|
|
|
202
202
|
resolve();
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
|
-
|
|
205
|
+
setTimeout(check, 10);
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
|
-
|
|
208
|
+
setTimeout(check, 10);
|
|
209
209
|
});
|
|
210
210
|
};
|
|
211
211
|
Debugger.prototype.interact = function (operationContext, item) {
|
|
@@ -243,11 +243,13 @@ var OperationContext = /** @class */ (function () {
|
|
|
243
243
|
OperationContext.prototype.step = function (item) {
|
|
244
244
|
var me = this;
|
|
245
245
|
var dbgr = me.debugger;
|
|
246
|
-
me.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
dbgr.
|
|
250
|
-
|
|
246
|
+
if (!me.injected) {
|
|
247
|
+
me.stackItem = item;
|
|
248
|
+
me.setLastActive(me);
|
|
249
|
+
if (dbgr.getBreakpoint(me)) {
|
|
250
|
+
dbgr.interact(me, item);
|
|
251
|
+
return dbgr.resume();
|
|
252
|
+
}
|
|
251
253
|
}
|
|
252
254
|
return Promise.resolve();
|
|
253
255
|
};
|
|
@@ -270,12 +272,16 @@ var OperationContext = /** @class */ (function () {
|
|
|
270
272
|
if (state.pending) {
|
|
271
273
|
state.exit = true;
|
|
272
274
|
return new Promise(function (resolve) {
|
|
273
|
-
|
|
275
|
+
var check = function () {
|
|
274
276
|
if (!state.pending) {
|
|
275
277
|
state.exit = false;
|
|
276
278
|
resolve(me);
|
|
277
279
|
}
|
|
278
|
-
|
|
280
|
+
else {
|
|
281
|
+
setTimeout(check, 10);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
setTimeout(check, 10);
|
|
279
285
|
});
|
|
280
286
|
}
|
|
281
287
|
return Promise.reject(new Error('No running process found.'));
|
package/dist/interpreter.js
CHANGED
|
@@ -119,7 +119,7 @@ var Interpreter = /** @class */ (function (_super) {
|
|
|
119
119
|
state: context_1.ContextState.TEMPORARY,
|
|
120
120
|
injected: true
|
|
121
121
|
});
|
|
122
|
-
return [4 /*yield*/, body.run(
|
|
122
|
+
return [4 /*yield*/, body.run(injectionCtx)];
|
|
123
123
|
case 3:
|
|
124
124
|
_a.sent();
|
|
125
125
|
return [3 /*break*/, 5];
|
|
@@ -139,7 +139,7 @@ var Interpreter = /** @class */ (function (_super) {
|
|
|
139
139
|
me = this;
|
|
140
140
|
last = me.apiContext.getLastActive();
|
|
141
141
|
if (me.apiContext.isPending()) {
|
|
142
|
-
me.inject(code, last);
|
|
142
|
+
return [2 /*return*/, me.inject(code, last)];
|
|
143
143
|
}
|
|
144
144
|
return [2 /*return*/, me];
|
|
145
145
|
});
|
|
@@ -186,10 +186,10 @@ var Interpreter = /** @class */ (function (_super) {
|
|
|
186
186
|
me.debugger.raise(err_2);
|
|
187
187
|
return [3 /*break*/, 8];
|
|
188
188
|
case 7:
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
setTimeout(function () {
|
|
190
|
+
me.apiContext.setPending(false);
|
|
191
191
|
me.emit('exit', me);
|
|
192
|
-
});
|
|
192
|
+
}, 100);
|
|
193
193
|
return [7 /*endfinally*/];
|
|
194
194
|
case 8: return [2 /*return*/, me];
|
|
195
195
|
}
|