Skip to content

Commit 827987f

Browse files
committed
test: make use of async/await (#1996)
1 parent 4d924bf commit 827987f

35 files changed

+629
-1328
lines changed

client-src/default/overlay.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import ansiHTML from 'ansi-html';
55
import { AllHtmlEntities as Entities } from 'html-entities';
66

77
const entities = new Entities();
8-
98
const colors = {
109
reset: ['transparent', 'transparent'],
1110
black: '181818',
@@ -95,7 +94,7 @@ function ensureOverlayDivExists(onOverlayDivReady) {
9594
}
9695

9796
// Successful compilation.
98-
function clear() {
97+
export function clear() {
9998
if (!overlayDiv) {
10099
// It is not there in the first place.
101100
return;
@@ -108,12 +107,14 @@ function clear() {
108107
lastOnOverlayDivReady = null;
109108
}
110109

111-
// Successful compilation.
112-
export function clear() {
113-
destroyErrorOverlay();
114-
}
115-
116110
// Compilation with errors (e.g. syntax error or missing modules).
117111
export function showMessage(messages) {
118-
showMessageOverlay(messages[0]);
112+
ensureOverlayDivExists((div) => {
113+
// Make it look similar to our terminal.
114+
div.innerHTML = `<span style="color: #${
115+
colors.red
116+
}">Failed to compile.</span><br><br>${ansiHTML(
117+
entities.encode(messages[0])
118+
)}`;
119+
});
119120
}

package-lock.json

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)