mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +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) {
|
||||
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
||||
println(e);
|
||||
println(`${e}`);
|
||||
}
|
||||
}
|
||||
while (!tbasexit) {
|
||||
@@ -3035,7 +3035,7 @@ while (!tbasexit) {
|
||||
}
|
||||
catch (e) {
|
||||
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
|
||||
println(e);
|
||||
println(`${e}`);
|
||||
}
|
||||
}
|
||||
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...
|
||||
let k = s
|
||||
.replace(/while *\([^\n]+\) *{/, "$& "+n+"();")
|
||||
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();");
|
||||
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();")
|
||||
.replace(/do *{/, "$& "+n+"();");
|
||||
//serial.println(k);
|
||||
return k;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user