Skip to content

Commit

Permalink
test: make use of async/await (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jun 15, 2019
1 parent 66f1159 commit 1aa82a8
Show file tree
Hide file tree
Showing 35 changed files with 629 additions and 1,328 deletions.
17 changes: 9 additions & 8 deletions client-src/default/overlay.js
Expand Up @@ -5,7 +5,6 @@ import ansiHTML from 'ansi-html';
import { AllHtmlEntities as Entities } from 'html-entities';

const entities = new Entities();

const colors = {
reset: ['transparent', 'transparent'],
black: '181818',
Expand Down Expand Up @@ -95,7 +94,7 @@ function ensureOverlayDivExists(onOverlayDivReady) {
}

// Successful compilation.
function clear() {
export function clear() {
if (!overlayDiv) {
// It is not there in the first place.
return;
Expand All @@ -108,12 +107,14 @@ function clear() {
lastOnOverlayDivReady = null;
}

// Successful compilation.
export function clear() {
destroyErrorOverlay();
}

// Compilation with errors (e.g. syntax error or missing modules).
export function showMessage(messages) {
showMessageOverlay(messages[0]);
ensureOverlayDivExists((div) => {
// Make it look similar to our terminal.
div.innerHTML = `<span style="color: #${
colors.red
}">Failed to compile.</span><br><br>${ansiHTML(
entities.encode(messages[0])
)}`;
});
}
16 changes: 11 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1aa82a8

Please sign in to comment.