Skip to content

Commit

Permalink
test: make use of async/await (webpack#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy authored and knagaitsev committed Jul 31, 2019
1 parent 5815cd2 commit 8b263b2
Show file tree
Hide file tree
Showing 34 changed files with 608 additions and 1,254 deletions.
17 changes: 9 additions & 8 deletions client-src/default/overlay.js
Original file line number Diff line number Diff line change
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])
)}`;
});
}
15 changes: 14 additions & 1 deletion package-lock.json

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

Loading

0 comments on commit 8b263b2

Please sign in to comment.