Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Update js
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Nov 18, 2024
1 parent f3be610 commit 9923b31
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,20 @@ var Module = {
printErr: (text) => {
displayError(text);
},
onExit: (status) => {
console.log(`Program exited with status: ${status}`);
elm_execute.disabled = true;
},
};

// Functions
const restartRuntime = () => {
console.log('Restarting runtime...');

Module.onRuntimeInitialized();
Module._main();
};

const getCookie = (cookie_name) => {
const name = cookie_name + "=";
const decodedCookie = decodeURIComponent(document.cookie);
Expand Down Expand Up @@ -240,6 +251,10 @@ const captureOutput = (showOutput, arguments) => {

elm_error.textContent = 'خطای غیرمنتظره رخ داد.';
showErrorInIframe();
} finally {
if (Module.noInitialRun) {
restartRuntime();
}
}
};

Expand Down

0 comments on commit 9923b31

Please sign in to comment.