Skip to content

Commit

Permalink
Make run always accept a parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Mar 14, 2024
1 parent a93b8a5 commit 5a74f5a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions koweb/js/kocheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ function fetch_then(url, f) {
});
}

async function run(program = undefined) {
async function run(program) {
remove_all_errors_dom();
remove_all_outputs_dom();

let text = program ?? document.getElementById('editor').value;
let eta = document.getElementById("eta").checked;
let omit = document.getElementById("omit").value;
check_single(text, eta, omit);
check_single(program, eta, omit);
}

document.getElementById("load_url").onclick = () => {
Expand All @@ -62,7 +61,7 @@ document.getElementById("load_url").onclick = () => {
};

document.getElementById("run").onclick = async () => {
await run();
await run(document.getElementById('editor').value);
};

document.getElementById("run_multiple").onclick = async () => {
Expand Down

0 comments on commit 5a74f5a

Please sign in to comment.