Skip to content

Pause failing on long-running programms. #495

@LeifAndersen

Description

@LeifAndersen

I would expect the following program to run for roughly 3 seconds, then print out Pausing..., followed shortly by PAUSED!. But instead it prints out Pausing..., but never actually pauses:

const prog = `
for(let i = 0; i < 100000000000; i++) {
  if(i%10000000 === 0) {
    console.log(i);
  }
}
`;

window.stopify = require('@stopify/stopify');
let runner = stopify.stopifyLocally(prog);
runner.g = {console};
runner.run(() => {
    console.log("DONE!");
});
setTimeout(() => {
    console.log("Pausing...");
    runner.pauseImmediate(() => {console.log("PAUSED");});
}, 3000);

If it helps, the following error seems to occur:

lazyRuntime.ts:15 Uncaught Capture {stack: Array(0), f: ƒ}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions