Skip to content

Commit

Permalink
🐛 execute() fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FurryR committed Mar 2, 2024
1 parent 198f2e7 commit 6bd5c5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scratch-vm
17 changes: 9 additions & 8 deletions src/compiler/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ export default function patchRuntime(vm: VM) {
return Reflect.get(target, p, receiver)
},
set(target, p, newValue, receiver) {
if (
p === 'status' &&
newValue === (threadConstructor as any).STATUS_RUNNING &&
!isPromiseWaitOrYieldTick
) {
return true
} else {
isPromiseWaitOrYieldTick = true
if (p === 'status') {
if (
newValue === (threadConstructor as any).STATUS_RUNNING &&
!isPromiseWaitOrYieldTick
) {
return true
} else if (newValue !== (threadConstructor as any).STATUS_YIELD) {
isPromiseWaitOrYieldTick = true
}
}
return Reflect.set(target, p, newValue, receiver)
}
Expand Down

0 comments on commit 6bd5c5a

Please sign in to comment.