greybel-interpreter 4.0.17 → 4.0.18
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/vm.js +11 -5
- package/package.json +1 -1
package/dist/vm.js
CHANGED
|
@@ -518,11 +518,17 @@ class VM {
|
|
|
518
518
|
const value = frame.scope.value.get(arg.name);
|
|
519
519
|
args.set(arg.name.toString(), value);
|
|
520
520
|
}
|
|
521
|
-
callback(this, frame.self, args)
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
521
|
+
const immediateRet = callback(this, frame.self, args);
|
|
522
|
+
// Due to transformations it can happen that return values may not be PromiseLike
|
|
523
|
+
if (immediateRet === null || immediateRet === void 0 ? void 0 : immediateRet.then) {
|
|
524
|
+
immediateRet.then((ret) => {
|
|
525
|
+
this.pushStack(ret);
|
|
526
|
+
this.resume(done);
|
|
527
|
+
}).catch(done);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
this.pushStack(immediateRet);
|
|
531
|
+
break;
|
|
526
532
|
}
|
|
527
533
|
case instruction_1.OpCode.SLICE: {
|
|
528
534
|
const b = this.popStack();
|