mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Follow up - Remove all innerHTML += for consistency sake (#2159)
This commit is contained in:
committed by
GitHub
parent
eb31e51a45
commit
ee3cd76022
@@ -91,9 +91,12 @@ async function execute({ currentTarget }) {
|
|||||||
return envs.get(env).then((xworker) => {
|
return envs.get(env).then((xworker) => {
|
||||||
xworker.onerror = ({ error }) => {
|
xworker.onerror = ({ error }) => {
|
||||||
if (hasRunButton) {
|
if (hasRunButton) {
|
||||||
outDiv.innerHTML += `<span style='color:red'>${
|
outDiv.insertAdjacentHTML(
|
||||||
error.message || error
|
"beforeend",
|
||||||
}</span>\n`;
|
`<span style='color:red'>${
|
||||||
|
error.message || error
|
||||||
|
}</span>\n`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
console.error(error);
|
console.error(error);
|
||||||
};
|
};
|
||||||
@@ -108,7 +111,10 @@ async function execute({ currentTarget }) {
|
|||||||
};
|
};
|
||||||
sync.writeErr = (str) => {
|
sync.writeErr = (str) => {
|
||||||
if (hasRunButton) {
|
if (hasRunButton) {
|
||||||
outDiv.innerHTML += `<span style='color:red'>${str}</span>\n`;
|
outDiv.insertAdjacentHTML(
|
||||||
|
"beforeend",
|
||||||
|
`<span style='color:red'>${str}</span>\n`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
notify(str);
|
notify(str);
|
||||||
console.error(str);
|
console.error(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user