mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-11 07:14:04 +09:00
STOP detection injection for do-loop
This commit is contained in:
@@ -3012,7 +3012,7 @@ if (exec_args !== undefined && exec_args[1] !== undefined) {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
||||||
println(e);
|
println(`${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (!tbasexit) {
|
while (!tbasexit) {
|
||||||
@@ -3035,7 +3035,7 @@ while (!tbasexit) {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
||||||
println(e);
|
println(`${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println(prompt);
|
println(prompt);
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ let injectIntChk = (s, n) => {
|
|||||||
// primitive way of injecting a code; will replace a JS string that matches the regex...
|
// primitive way of injecting a code; will replace a JS string that matches the regex...
|
||||||
let k = s
|
let k = s
|
||||||
.replace(/while *\([^\n]+\) *{/, "$& "+n+"();")
|
.replace(/while *\([^\n]+\) *{/, "$& "+n+"();")
|
||||||
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();");
|
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();")
|
||||||
|
.replace(/do *{/, "$& "+n+"();");
|
||||||
//serial.println(k);
|
//serial.println(k);
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user